Screen Space Ambient Occlusion (SSAO)

The Screen Space Ambient Occlusion (SSAO) image effect approximates Ambient Occlusion in realtime, as an image post-processing effect. It darkens creases, holes and surfaces that are close to each other. In real life, such areas tend to block out or occlude ambient light, hence they appear darker.

For a modern implementation of real-time ambient occlusion, have a look at the newer Screenspace Ambient Obscurance effect.

As with the other image effects, this effect is only available in Unity Pro and you must have the Pro Standard Assets installed before it becomes available.


SSAO applied to the scene.

The same scene without SSAO for comparison. Note the differences at the corners where structures or grass meet the ground.

Properties

RadiusThe maximum "radius" of a gap that will introduce ambient occlusion.
Sample CountNumber of ambient occlusion samples. A higher count will give better quality but with a higher processing overhead.
Occlusion IntensityThe degree of darkness added by ambient occlusion.
BlurAmount of blur to apply to the darkening. No blur (0) is much faster but the darkened areas will be noisy.
DownsamplingThe resolution at which calculations should be performed (for example, a downsampling value of 2 will work at half the screen resolution). Downsampling increases rendering speed at the cost of quality.
Occlusion AttenuationHow fast occlusion should attenuate with distance.
Min ZTry increasing this value if there are artifacts.

Details

SSAO approximates ambient occlusion using an image processing effect. Its cost depends purely on screen resolution and SSAO parameters and does not depend on scene complexity as true AO would. However, the approximation tends to introduce artifacts. For example, objects that are outside of the screen do not contribute to occlusion and the amount of occlusion is dependent on viewing angle and camera position.

Note that SSAO is quite expensive in terms of processing time and generally should only be used on high-end graphics cards. Using SSAO will cause Unity to render the depth+normals texture of the camera which increases the number of draw calls and has a CPU processing overhead. However, the depth+normals texture then can be used for other effects as well (eg, Depth of Field). Once the texture is generated, the remainder of the SSAO effect is performed on the graphics card.

Hardware support

This effect requires a graphics card with pixel shaders (3.0) or OpenGL ES 2.0. Additionally, depth texture support is required. PC: NVIDIA cards since 2004 (GeForce 6), AMD cards since 2005 (Radeon X1300), Intel cards since 2006 (GMA X3000); Mobile: OpenGL ES 2.0 with depth texture support; Consoles: Xbox 360, PS3.

All image effects automatically disable themselves when they can not run on end-users graphics card.

Page last updated: 2013-02-06