Full screen with random SSAO samples

There we are! The last missing piece was to remove the aliasing that was apparent due to the regularity of the sampling we were doing on every surface fragments. To solve this, a simple method is to rotate the samples around the surface normal of the fragments. That random rotation is calculated (in my case) with shader code applied on the X and Y coordinates of the current fragment (re-using online code snippets).

Finally, to help debug this better (and to show it off now that it is finally working!!!) I added code to switch to a full screen, mouse controlled, camera by pressing enter. Again, this was simple to add, thanks to the quality object oriented design of the project. The feature proved useful since SSAO is subtle. Thus, having a way to zoom in on the models while refreshing the shader code was very valuable:

Full screen rendering of BRDF with 128 SSAO samples

Lots of effort, for a subtle effect... (toggle on/off visible at the 11 and 14 seconds mark)

Time spent for this Time spent so far
5 h 180 h

See also