lunedì 4 dicembre 2017

Day 214: Optimized and integrated SSAO

Today I decided to improve SSAO, and to integrate it into the pipeline of the engine. This required a few steps:

1) Move the SSAO shader to the engine code, and make it independent from the post processor, so that it can be used withing the deferred rendering pipeline

2) Instead of using the results directly, store a low-precision single-channel texture in the G-Buffer (actually 2, because of step 3).

3) Create 2 shaders to apply vertical and horizontal blur. They alternatively use the two occlusion textures.

4) Apply the results only to ambient light in the directional light shaders.

As you can see from the picture, the bilateral filtering makes the noise go away quite well, and finally the "shadows" look like shadows. On top of that, applying the results only to ambient light makes the effect much nicer when other lights interact with it.


Nessun commento:

Posta un commento