Implementing screen space ambient occlusion
Screen space ambient occlusion (SSAO) can be used to approximate the effect of ambient occlusion in real time. Ambient occlusion is a shading and rendering method used to calculate how exposed each point in a scene is to ambient lighting. This technique adds more realistic shadows where two surfaces or objects meet, or where an object blocks light from reaching another object.
In this recipe, you will learn how to implement SSAO to realistically estimate ambient occlusion in real time. You will grasp how to use this shading and rendering technique to calculate the exposure of each point in a scene to ambient lighting.
Getting ready
The algorithm described in this recipe calculates the difference between the depth of a pixel and its neighbors (samples) in a circular fashion. If a sample is closer to the camera than the central pixel, it contributes to the occlusion factor, making the pixel darker.
A depiction of the algorithm is...