SSAO/SSLR/Deferred shading

Simple implementation as proof of concept:

Screen Space Reflections + Deferred shading

Ambient Occlusion

It would be great to have floating point render targets for things like this, so everyone interested please vote: floating point RT

20 Likes

Just wondering if you can use a normal RT (RGBA) 8 bits per component, then cast in the shader to a 32bit float? I think this could work - havent tried it though, the sky renderer sort of does this, but its a little different.

This is a really nice result though. Will try it out with my blender export tool :slight_smile:

Yes, same approach here. But it would be better to keep position as well and don’t bother to restore it from depth in shader (to avoid possible errors).

1 Like

I agree. A more flexible RT could be very useful - also on the compute side of things too. I think there is the issue of cross platform support and vulkan… etc etc… bit of a minefield I guess.

1 Like

Wow. Your SSLR looks really nice. I dropped in an export and scaled the floor to match. Very cool.


I realize now too that the scaling up of the model reduces the reflection effect. Still noticeable though. Great stuff.

5 Likes

I think I should rework this by moving computations into view space with linearised depth. Will do tomorrow.

SSAO example now have “multi-frame” branch, where occlusion is computed using half of the samples in a given frame, and the result averaged with that of the previous frame.

6 Likes

SSLR example is updated with simplified view-space computations.
@dlannan for scenes like this it should be combined with cube-map environment mapping.
Also ray tracing algorithm is very simple here, there are different approaches with ray increment until you get an intersection and binary search afterwards. I believe it can give better result, but requires some kind of reflection map to avoid performance issues (so we apply heavy shader only on glossy surfaces)

4 Likes

Brilliant work! Yeah the floating point RTs is a bit of a ”strange” thing to not support, but it’s not universally supported by GL 2.0 spec on all platforms which is the reason it’s not exposed afaik. We really need to have it to enable certain effects imo.

4 Likes

Let’s discuss the implementation on GitHub:

  • What does it require from an API standpoint?
  • Are there fallbacks if not supported or do we leave it to the developer?
  • Vulkan vs OpenGL?
2 Likes

@Ivan_Lytkin - yeah a cube map/env map is what Im using for my pbr setup (incomplete atm).
Generally easier to manage from an art aspect too. Im looking at coupling it (env map) to light probes etc… get some better looking GI and shadows. A little bit down the track though :slight_smile: … imho, Defold is kinda nice for this, since I can throw in shaders into the render pipe how and when I want. Not many engines let you do that as easily (imho).

2 Likes