Page 1 of 2

Lighting

Posted: Sun May 10, 2015 8:48 pm
by andrewmac
I've been working on lighting this weekend. I've got normal maps (on the floor) and metalness/glosiness in however in this progress video the whole scene has hardcoded metalness/glossiness so that's why it all looks shiny:



I still have to add metalness and glossiness to the gbuffer before those maps can be loaded in and/or fixed values per material can be supplied. The equations I have in place can easily take environment and irradiance maps so I might try making environment map volumes that capture those either in real time and/or bake them.

Re: Lighting

Posted: Mon May 11, 2015 6:20 am
by buckmaster
Looks nice!

Re: Lighting

Posted: Sat May 16, 2015 5:43 pm
by andrewmac
Early version of environment mapping, everything in the scene is set to 0.8 metallic, 0.8 glossiness:



Still trying to get all the equations right (spoiler: they're wrong at the moment, but getting closer) and then I'll add some volumes for generating static cubemaps for areas. Should allow pretty cheap and good looking lighting. I don't plan on going into real-time GI until later when the engine is more stable. Much more pressing matters. However, I will try to do SSR sooner rather than later so we can have some real-time reflections to go with the baked ones.

Re: Lighting

Posted: Sat May 16, 2015 9:03 pm
by andrewmac
Still not quite perfect but we're making progress for sure:


Re: Lighting

Posted: Sun Jun 07, 2015 11:17 pm
by andrewmac
I finally replaced the crappy simple shadowmapping with something more robust. It's Cascaded Variance ShadowMaps. There's a couple of options that can be tweaked related to them. I'll refine them later and perhaps expand them to expontential variance shadow maps.

Cascade debug:
Image

Early version with no blur:
Image

Again, no blur:
Image

Blurred. Getting better, still at 512 per cascade:
Image

Blurred at 1024 per cascade, good enough for now:
Image

Re: Lighting

Posted: Wed Jun 10, 2015 12:46 am
by andrewmac
Early version of screenspace reflections:

Image

Re: Lighting

Posted: Wed Jun 10, 2015 3:51 am
by andrewmac
Got the SSR shader in a more stable state. In the previous screenshot as you flew around the reflections went all wacky, but I got it to the point where they're actually video worthy:



Keep in mind it's lacking error correction, blurring, and actually taking metalness into account. Right now everything in the scene reflects.

Re: Lighting

Posted: Thu Jun 11, 2015 2:17 am
by andrewmac
I put in some error handling on the SSR shader. It works by calculating how much the angle of reflection is coming towards the camera as well as how close we're getting to the edge of the screen while travelling the ray. It fades smoothly based on those factors. I also increased the step size in the ray which means you can see more in the reflections now. The downside is increased banding in the reflections. I have a few ideas on how to fix that, we'll see how they go.


Re: Lighting

Posted: Mon Aug 03, 2015 2:24 am
by andrewmac
Finally implemented a proper PBR lighting setup. Lambert diffuse, GGX specular, IBL for ambient.

Image

Re: Lighting

Posted: Mon Aug 03, 2015 9:08 am
by LukasPJ
That's all fine and dandy, but what about puppy shader? :(
Image