Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Showcase / First little PBR test scene

Author
Message
GaborD
User Offline
Joined: 3rd Dec 2017
Location:
Posted: 28th Jan 2018 01:49
Hi guys, I am new to AppGameKit, toyed with the demo a bit a while ago and got great support when I had some issues, so that sealed the deal for me to focus on AGK.
So far I am impressed, great flexibility and superb speed. Going to start on a game soon, but first I am testing features and trying to push image quality a bit.

For the testing I made a very quick first scene that basically is a summation of everything that is a worst case scenario. Thin long shiny metallic sharply beveled edges (specular aliasing is 10 times worse than edge aliasing ), big area lights very close to geometry, often even touching it, huge flat semi-shiny floor with objects on top in the middle, transparent rough panel that needs blurry refractions, etc. A good way to push and improve my rendering setup.

All lighting/reflection probes are calced in AppGameKit, no lightmaps. Had to completely rewrite my system (had to port it to AppGameKit anyway, so no biggie), the 8-mip probes just weren't good enough to support all the subtle roughness differences.
Probes are fully HDR and can be quite high rez (not too crazy though :p )

Here are some shots from the first test with the level, I added some weird stuff, just for fun: 4x supersampling, FXAA, bokeh DoF, parallaxed fake window with steam on it, realtime AE lights, volumetric soft shadows, ACES tonemapping, etc.
My goal was to get it close to how a render of the scene looks, but still run at comfortable speed with tons of headroom for later when adding game related things. Still needs a lot of optimization, will add to the thread when I improve it. I bet the speed can be doubled when cleaning up all the shader code.
Sorry forthe big images, the only way to show the image quality. Got rid of most jaggies, even on the shiny edges. Just some last stragglers to iron out.

Really loving AppGameKit so far!

Attachments

Login to view attachments
Cliff Mellangard 3DEGS
Developer
12
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 28th Jan 2018 12:19
c0d3r9
User Offline
Joined: 2nd Oct 2017
Location: Germany
Posted: 28th Jan 2018 12:44
Looks awesome.
GarborD the shader god is here
Arbrakan
7
Years of Service
User Offline
Joined: 10th Oct 2010
Location: Geneva
Posted: 28th Jan 2018 14:15
Wow, awesome !, finally some BPR shaders Great work !!
janbo
9
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 28th Jan 2018 14:23 Edited at: 28th Jan 2018 15:26
Looks good,
I didn't continue my PBR shader cause I thought it would be too slow for mobile.
Well done, how did you made the reflections and is it Tier1 ?
Is the reflection map prebaked because you also catched the other objects with the PBR shader attached in the reflection map ?

This is how far I have come, I had no reflection maps at this time but it still has metallic,roughness and ao.
I don't have such a fancy scene (also well done) but it works... maybe I should spent some time with it again


What kind of game you want to make with it ?

Attachments

Login to view attachments
Bengismo
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 28th Jan 2018 15:37
Wow, this looks great. I had no idea realtime PBR had come so far...especially if this can run at a decent framerate.
Blendman
4
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 28th Jan 2018 16:50
Hi
Its really amazing. Is that realtime, seriously ?
How much faces have you on this scene ? And what is the size of your textures?
Could make a video with your scene to see it in realtime ?
How much shader have you write to get this result?
The lighting is a pbr shader or other things (pbg+lights) ?
Do you plain to sale or gave your shaders to play with it ?
could we see the scene without the shaders, to see the differences ?
AGK2 tier1 - http://www.dracaena-studio.com
GaborD
User Offline
Joined: 3rd Dec 2017
Location:
Posted: 28th Jan 2018 18:47 Edited at: 29th Jan 2018 13:29
Thnk for the comments guys.

@Cliff Mellangard
This is aimed at PCs, but I will look into mobile friendly setups soon.
The shaders shouldn't be an issue, they are pretty straight forward.

@janbo
Yes Tier 1. The reflections are all probe based. (mostly just straight up probes, and some parallaxed ones for the floor). Plus a few realtime lights (the sphere lights and the blue-ish lights on the walls)
You should definitely continue with yours, almost there, just needs the reflections.
I like that scene, a floor and a sphere was my main test scene for many years, just ask anyone who used to be on the NB forums haha. I posted so many sphere shots.

@Blendman
Yes realtime. Not as fast as I want it to be yet, but that's a matter of optimization. Can probably double speed, the DoF is just bruteforced currently, Huge slowdown.
The 4x supersampling is ofcourse also a slowdown. Basically drawing all pixels 4 times.

The scene itself with the PBR shaders (with supersampling, FXAA and DoF off) is really fast, over 800FPS on a GTX1070 at fullHD. Could render it 13 times per frame and still achieve stable 60
Screens of it with Fraps FPS counter attached. Ofcourse, without any AA it's a jaggie convention.
I am sure it could run on mobile if the texture sizes were lowered. Would also give another huge speed boost I reckon, even on PC. I went a bit overboard with texture sizes because I wanted to be able to do extreme closeups.

Attachments

Login to view attachments
GaborD
User Offline
Joined: 3rd Dec 2017
Location:
Posted: 28th Jan 2018 18:54
@Blendman
For the rendering itself I only had to write the main PBR shader, a refraction shader for the window and panel and 2 fullscreen shaders for DoF and FXAA (which I just ported from HLSL)
But for probe generation I also had to write two shaders because I do it completely on the GPU.
Face count is pretty low, all the details are baked to textures.
GarBenjamin
1
Years of Service
Recently Online
Joined: 30th Nov 2016
Location: USA
Posted: 28th Jan 2018 18:57 Edited at: 28th Jan 2018 18:57
Welcome and good to have you here GaborD. Out of curiosity, where did you come from... what did you originally use to create this system before porting it over to AGK2?

Looks like some fantastic work. I am not into realistic looking graphics for games but it is impressive all the same. Particularly a couple of these scenes look fantastic IMO.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
GaborD
User Offline
Joined: 3rd Dec 2017
Location:
Posted: 28th Jan 2018 21:28 Edited at: 28th Jan 2018 21:51
Thanks for the nice welcome.
Back in the day I started with Gamestudio (the early versions), then as soon as Blitz3D was available used and loved that. Also used DarkBasic for quite a while.
Later I was very active in the NB community, it was such a fantastic engine, too bad it never got finished.
A lot of my tech tidbits are ported from NB (which used DX/HLSL) or were originally made for C3D (which I worked on graphics side, unfortunately the project got cancelled )

With AppGameKit I have finally found a stable great feature complete engine that gives enough freedom to tweak rendering. Plan on developing a lot of things with it.
I agree on realistic graphics in games, not my favorite style either. But a more realistic approach is a great way to test the basic rendering setup.
hoyoyo80
1
Years of Service
User Offline
Joined: 11th May 2016
Location:
Posted: 28th Jan 2018 21:53
Wow!!! That look awesome!!!
janbo
9
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 28th Jan 2018 21:54 Edited at: 28th Jan 2018 22:28
Whats the NB forum/engine ?
Quote: "You should definitely continue with yours, almost there, just needs the reflections"

Thanks I guess, thats why i'm asking, I want the very best for AGK... you live and learn
Do you use some sort of cube-mapping, dual-parabolic mapping or some other sort of view independent environment-mapping ?
I guess, its not dualparabolic mapping and sphere mapping isn't view independent, so you probably render the scene 6 times and encode them somehow into one huge texture ?

I probably only ask this questions because I don't know reflection probes yet
I'm using dualparabolic-mapping, cause it only needs two textures, its really fast (you can render it real time even on mobile phones)

I'm happy that there are joining so many new people lately, they bring cool stuff with them
puzzler2018
User Offline
Joined: 8th Oct 2017
Location:
Posted: 28th Jan 2018 22:00
Fantastic- I love the idea of you promoting AppGameKit well done
GaborD
User Offline
Joined: 3rd Dec 2017
Location:
Posted: 28th Jan 2018 23:16
@janbo
You were right with the initial thought. I do render the six main directions with 90 degrees FOV and then run a shader pass that combines it all into a latlong (like HDRIs) texture, then use that for the convolution pass. (because the convolution uses a ton of lookups and fetching from a single latlong is much faster)
I will have to look into dual parabolic, could be a speedup and additionally let me skip the first pass. Thanks for the idea.
My main difficulty was to get the floor to look like the pathtraced target renders. So many subtle roughness differences and the parallaxed probe reflections have to mesh perfectly with the realtime tube lights (the blueish lights). Switching the probes to GGX convolution helped because the realtime lights use GGX for the specular reflections too. Still have to tweak the brightness values for the realtime lights, I think I messed something up while porting them haha.

Attachments

Login to view attachments
Conjured Entertainment
AGK Developer
12
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 29th Jan 2018 00:13
As I said the first time I saw these... AMAZING!

I am glad to see you here.

Welcome to the AppGameKit forums!

I have not played very much with shaders in AppGameKit, but your work is so awesomely inspiring that it will be very difficult not to.

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
wyrleywolves2
User Offline
Joined: 16th Jan 2018
Location:
Posted: 29th Jan 2018 00:36
Well Done! This looks absolutely lush.
janbo
9
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 29th Jan 2018 02:06 Edited at: 29th Jan 2018 02:41
Looks fine to me, is the white light one of the area lights that already used GGX ? (I'm also using GGX)
Interesting, I only know the environment maps that are meant to reflect things at infinite distance and ofcourse the mirrored camera under floor method.
I understand that you can switch/interpolate between two environment maps but what the heck is parallax corrected cubemapping ?
How do you create a corrected cubemap using a box projection and then sample it from a latlong texture
That makes me wonder if the correction is in the creation process of the envmap or only in the sampling process of the envmap ?
Many questions
GaborD
User Offline
Joined: 3rd Dec 2017
Location:
Posted: 29th Jan 2018 03:20 Edited at: 29th Jan 2018 03:38
It's just a sampling thing.
You reflect your view ray as usual, but instead of directly using it to look into the probe/cubemap you use it to intersect a box that defines where your walls, ceiling and floor are. An axis aligned box keeps the math very easy/fast and is a widely used version of this. Obviously, it means you have to build levels accordingly.
For a bit more freedom you could also use rotated box volumes and just transform the reflection vector accordingly (basically into "box space") to keep the simple intersection math.
Or, for more complex levels you could maybe intersect circles or arbitrary lines in 2D (on a horizontal plane) and then calculate the height of the actual intersection point from that. If it's above the ceiling or below the floor, you know those were hit first and can easily adjust accordingly.

The intersection point you find is where your reflected view vector hits a wall/floor/ceiling in 3D, it's the spot your probe lookup has to fetch.
You also know the location the probe was captured from. (well, hopefully ) Thus you can do a simple normalize(IntersectionPoint - ProbePosition); to find the correct direction vector you have to use to look into the probe/cubemap.

The biggest downside is that on totally flat very shiny surfaces the lower resolution of the probes will become very apparent.

And yes, the white ones are realtime capsule lights.

In other news, I started optimizing. Can hit semi-decent speeds with supersampling+FXAA+DoF now.

Attachments

Login to view attachments
Carharttguy
1
Years of Service
User Offline
Joined: 8th Jul 2016
Location: Belgium
Posted: 29th Jan 2018 07:13
Thumbs up! This looks amazing!
Hughbus
AGK Backer
4
Years of Service
User Offline
Joined: 24th Oct 2013
Location:
Posted: 29th Jan 2018 07:31
Can i but this yet!?

Looks really amazing and is one of the things i've really wanted to see in AppGameKit for a while. I use a PBR workflow in my regular job and really wish it was something that existed in AGK. Love the platform and its so easy for an artist like me to code in. Just wish things like this existed for me to exploit as well.
Arbrakan
7
Years of Service
User Offline
Joined: 10th Oct 2010
Location: Geneva
Posted: 29th Jan 2018 07:39
@janbo keep up the good work ! Can't wait to see BPR shader to the Shader Pack
Blendman
4
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 29th Jan 2018 08:45
@GaborD :
seriously, your workflow and scene are amazing.
Will you sale it ?
Is it "easy" to use those kinds of shaders ?
PBR is a fullscreen shader (or several like we can see here : https://www.syntaxbomb.com/index.php/topic,4021.msg12150.html#msg12150) ?

How do you get the AO pass and lighting ? it's really great !

Keep up your great work.
Thanks a lot to use AppGameKit .
AGK2 tier1 - http://www.dracaena-studio.com
baxslash
11
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 29th Jan 2018 11:32
Just Wow! I can't believe what people are doing with AppGameKit these days. I wish I had more time to play!!
Using AppGameKit V2 Tier 1
Green7
12
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: Switzerland
Posted: 29th Jan 2018 11:45
need...
GaborD
User Offline
Joined: 3rd Dec 2017
Location:
Posted: 29th Jan 2018 13:01 Edited at: 29th Jan 2018 13:06
Thanks for the comments guys!

@Blendman
It was just a first quick test so I didn't put much thought into what to do with it. Primary goal is to use it for own games, but I wouldn't mind making an easy to use pack out of it.
It's just a lot of time to do so, hopefully I get to it soon-ish. As we wall know, implementing things for yourself is the easy part, making it user friendly and flexible is the real work.
I will have to look into mobile exports first though, because the community is so mobile focussed and I am a PC only guy. I don't even have an Android device to test on, and no Mac to export to my iPad. Will test around with the HTML5 exporter.

To your ease of use question: It's just a simple object shader.
You load it with LoadShader, put it on an object and add the PBR ready surface textures. (Diffuse, metallic, Normal, AO, roughness). Can pack it into two textures basically because we only need two channels for the normal. Last slot you add the probe texture and you are done. For special objects with alpha clipping, parallaxing or partial emission I have a three texture version.
The object shader can either tonemap internally or write out HDR to be used in post (because we need HDR data in post for correct bokeh, bloom, etc). Easy to toggle with a setShaderConstantByName.
Also implemented a simple system to generate probes in AppGameKit and save them out as png (or put them into a texture slot with copyImage). So that's basically just a function call with the coordinates to capture from and a filename.
I purposedly made everything really easy to use, so that I can iterate quickly when building and testing levels.

Another idea is to add realtime probes that are lower quality but fast enough to generate at runtime, could be useful for some weirder dynamic level setups.
Later I also want to port my realtime GI system I had in NB. Was fast enough for game usage. But I am not sure it would run on mobile.
Rick Nasher
User Offline
Joined: 25th Jul 2017
Location:
Posted: 29th Jan 2018 18:29
@GaborD
I already said how much I liked it, but I will do it again: Freaking awesome!

@janbo
I didn't see this one answered(or I'm overlooking): I think NB = Nuclear Basic.

GarBenjamin
1
Years of Service
Recently Online
Joined: 30th Nov 2016
Location: USA
Posted: 29th Jan 2018 18:52 Edited at: 29th Jan 2018 18:54
Nuclear Basic. lol An interesting one. I found that a couple of years ago. Was very interested in trying it out. I made an initial post introducing myself and asking a few questions. The next thing I knew I was banned. A mod even looked into it and could see that someone had indeed banned me did not understand why and could not see who had done it. LOL! So that ended my time with Nuclear Basic. All is good though I found AGK2!
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
Ron Erickson
Moderator
15
Years of Service
User Offline
Joined: 6th Dec 2002
Location: Pittsburgh, PA, USA
Posted: 29th Jan 2018 20:22
Amazing work GaborD!
a.k.a WOLF!
Chris Tate
DBPro Master
9
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 29th Jan 2018 21:23
Breathtaking and inspirational work GaborD. I particularly like the texture mapping, edge definition and depth of field the most; quite lovely.
Conjured Entertainment
AGK Developer
12
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 2nd Feb 2018 04:29

Congratulations on the Valued Member badge!!!

I think that is the fastest I have ever seen anyone get that.


Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
GaborD
User Offline
Joined: 3rd Dec 2017
Location:
Posted: 2nd Feb 2018 07:52 Edited at: 2nd Feb 2018 08:02
Thanks guys

Had some time to finish up some things, completed the post chain with color grading, AC, bloom, filmic tonemapper and lens dirt to have more stylistic freedom. Also improved DoF a bit, less artefacts at mid ranges.
Next feature is also almost done, but that will need a different test scene. Will work on that this weekend.
For now, some shots with the added features.

Attachments

Login to view attachments
hoyoyo80
1
Years of Service
User Offline
Joined: 11th May 2016
Location:
Posted: 2nd Feb 2018 08:29
Wow!!! I wish i can play with that...just play..i dont any of my ideas may use realistic scene..but think again maybe adventure game will benefit more...
GarBenjamin
1
Years of Service
Recently Online
Joined: 30th Nov 2016
Location: USA
Posted: 2nd Feb 2018 19:58
This screams modern syfy fps game to me. Maybe rpg syfy fps game. Could use for a medieval style rpg as well.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
hoyoyo80
1
Years of Service
User Offline
Joined: 11th May 2016
Location:
Posted: 3rd Feb 2018 00:25
I always think on making novel like game like "stranger than fiction" movie but i have no idea to create a good story line and game. With PBR, player can enjoy nice city view/sub urb area etc.
RickV
TGC Development Director
17
Years of Service
User Offline
Joined: 27th Apr 2000
Location: United Kingdom
Posted: 5th Feb 2018 16:50
I continue to be amazed and impressed!
Development Director
TGC Team
GaborD
User Offline
Joined: 3rd Dec 2017
Location:
Posted: 5th Feb 2018 21:21
@GarBenjamin Yes, agree on the RPG part. Would be a good fit too. If I make a game, the setting will be more RPGish than Sci-Fi.

@hoyoyo80 I hope you will make that game, sounds very interesting.

@RickV Thanks much!
I am really enjoying AppGameKit, holds up so well with heavy scenes and tons of effects.

Here are some shots that show the render components in such a setting. The reflection one shows how important having a fitting probe system is for PBR. Reflections basically dominate such a scene. Even the non-metallic rough parts have subtle reflections.
More coming soon, already built the next test scene. Just have to optimize it and add the AppGameKit side things I want to test next

Attachments

Login to view attachments
janbo
9
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 5th Feb 2018 23:22
Ah.. you follow the metallic workflow !
Is it still forward rendering or deferred rendering and did you made SSAO or is it all baked ?
hoyoyo80
1
Years of Service
User Offline
Joined: 11th May 2016
Location:
Posted: 6th Feb 2018 02:11
Even your model is high quality, the way i see at ur diffuse sample.

I think i remember u from nuclearbasic forum that always play around with shaders
Preben
13
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 7th Feb 2018 12:11
Amazing PBR scene/shaders, great work there GaborD
Subscribe and checkout great AppGameKit video's here: Videos click here
Latest GameGuru Loader news: News click here
Get GameGuru Loader PBR version here: Steam click here
best regards Preben Eriksen,
Phaelax
DBPro Master
14
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 7th Feb 2018 15:28
Someone wanna tell me what PBR means? (other than pabst)
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
Ortu
DBPro Master
10
Years of Service
Recently Online
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 7th Feb 2018 17:21 Edited at: 7th Feb 2018 17:22
Physically based rendering.

It uses texture maps that better describe physical materials and surfaces

Albedo, roughness, metallicity/reflectivity etc

Instead of the older diffuse, specular, etc
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
GaborD
User Offline
Joined: 3rd Dec 2017
Location:
Posted: 7th Feb 2018 17:56 Edited at: 7th Feb 2018 18:20
@Phaelax
What Ortu said
It helps with realism in realtime 3D to try to simulate how light reacts with surfaces in the real world.
The basic setup is quite straight forward with just two basic types of materials that are supported in a single shader (metals and non-metals), but as usual the devil is in the details like for instance needing tons of reflection data for your entire scene. This is a challenge, especially because this data has to be correctly convoluted for blurry reflections on rough surfaces and has to be HDR.
Basically, the shader is the easy part, the real work is the other stuff.
All your media also has to have surface data for things like roughness and metallic value when using the rough-met workflow (or a separate reflection color value if using the spec-gloss workflow)

PBR is a great solution to push rendering towards realism while still leveraging the current rasterization oriented hardware and maintaining high speed.

@Preben Thanks!

@hoyoyo80 Yes that was me, loved NB

@janbo Forward, didn't test deferred yet. I usually don't have tons of lights or tons of overdraw, so deferred is not that interesting to me. I hate using fill lights to fake GI, I'd rather work on a GI implementation. It's not SSAO. Will play around with that soon though.

Attachments

Login to view attachments

Login to post a reply

Server time is: 2018-02-21 01:25:21
Your offset time is: 2018-02-21 01:25:21