Screen Space Ambient Occlusion (SSAO)
Ambient Occlusion (AO) is a type of lighting technique applied in-game to create more realistic lighting. AO simulates global ambient lighting. AO can be rendered in real-time through Screen Space Ambient Occlusion (SSAO), a shading method which is able to closely simulate the effects of real AO with little loss of performance.
SSAO works by examining an onscreen pixel, and then comparing its location in the depth buffer to the pixels around it. Pixels which are close together but not coplanar (on the same face) are shaded to simulate soft shadows. To maintain playable framerates, it is not possible to sample every pixel every frame, so random sampling is used, which will inevitably create noise/grain which may be more noticeable with movement. To counter this, the SSAO pass is often Gaussian blurred to remove such grain.
Because the depth buffer is measured from the camera, the shading may look different along the edges of the screen. This can be combated by rendering additional information outside of the current camera's bounds.
SSAO in the Source Engine
