Implementing SSAO in OpenGL
Screen Space Ambient Occlusion (SSAO) is an image-based technique to roughly approximate global illumination in real time. Ambient occlusion itself is a very crude approximation of global illumination. It can be thought of as the amount of open "sky" visible from a point on a surface and not occluded by any local adjacent geometry. In its simplest form, we can estimate this amount by sampling several points in the neighborhood of our point of interest and checking their visibility from the central point.
Getting ready
The Chapter8/GL02_SSAO
demo application for this recipe implements basic steps for SSAO. Check out two previous recipes in this chapter, Implementing offscreen rendering in OpenGL and Implementing fullscreen quad rendering, before proceeding with this one.
How to do it...
Instead of tracing the depth buffer's height field, we use an even simpler approach where every selected neighborhood point is projected onto the...