Ambient light is a light type in computer graphics that is used to simulate global illumination. Ambient occlusion is simply a simulation of the shadowing caused by objects blocking the ambient light. Because ambient light is environmental, unlike other types of lighting, ambient occlusion does not depend on light direction. As such, it can be pre-computed for static objects.
Without AO (left) Note that the shadow in the left image is caused by directional light, with AO (right).
In traditional Ray Tracing ambient occlusion is simulated by sampling rays from a certain point, which takes a shape of a hemisphere, and then is checked for intersection with the scene (also called Object Space AO).
Notice how ray samples are used to simulate AO integration.
Notice the aliasing (dots) caused by ambient occlusion under-sampling.
Because the ray tracing sampling technique is too slow to be used in real time computer graphics, other methods emerged that simulate this behavior. One notable approach is called Screen Space Ambient Occlusion (SSAO).
SSAO is a screen-space technique developed by Crytek. The ambient occlusion is computed in a full-screen pass, using the Z-buffer as the only input.
The ambient occlusion factor kA of each pixel is estimated by testing a set of points distributed in a hemi-sphere around the pixel's location. This effectively simulates the traditional ray tracing approach in screen space.
The value of kA depends on the samples that are in front of the value in the Z-buffer. If half or more of the samples pass a depth test (that is, they arec closer to the camera than the center pixel), then kA receives a value of 1. A smaller number of samples result kA less than 1.
SSAO component of a typical game scene