Screen Space Ambient Occlusion (SSAO) image effect
Manual     Reference     Scripting   
Reference Manual > Components > Image Effect Scripts > Screen Space Ambient Occlusion (SSAO) image effect

Screen Space Ambient Occlusion (SSAO) image effect

Screen Space Ambient Occlusion (SSAO) approximates Ambient Occlusion in realtime, as an image post-processing effect. It darkens creases, holes and surfaces that are close to each other.

Like all image effects, SSAO is only available in Pro version of Unity. Make sure to have the Pro Standard Assets installed.
If you want to include the SSAO image effect, then click on Component -> Image Effects -> Screen Space Ambient Occlusion.


SSAO applied to the scene.

For comparison, no SSAO. Note differences where structures or grass meet the ground.

Properties

RadiusOcclusion radius.
Sample CountNumber of ambient occlusion samples. The higher the same count, the better the quality (but more expensive to compute).
Occlusion IntensityIntensity of ambient occlusion.
BlurAmount of blur to apply to ambient occlusion. No blur (0) is much faster, but the image will be noisy.
DownsamplingAt what resolution calculations should be performed. Downsampling value of 2 will perform them at 2x2 smaller resolution than screen; value of 1 will perform at screen resolution; etc. More downsampling is faster to compute.
Occlusion AttenuationHow fast occlusion should attenuate with distance.
Min ZTry increasing this value if there are artifacts.

Details

SSAO computes ambient occlusion purely in image space. It's cost only depends on screen resolution and SSAO parameters, and does not depend on scene complexity. However, because it is an image effect, it has some artifacts: objects that are outside of the screen do not contribute to occlusion; computed occlusion is dependent on viewing angle and camera's position and so on.

Note that SSAO is quite expensive effect and generally should only be used on high-end graphics cards. Using SSAO will cause Unity to render depth+normals texture of the camera, which increases number of draw calls and is a cost on the CPU. However, that depth+normals texture then can be used for other effects as well (like Depth of Field). SSAO effect itself is only a cost on the graphics card.

Hardware support

SSAO works on graphics cards with Shader Model 3.0 support. E.g. GeForce 6 and later, Radeon X1300 and later. All image effects automatically disable themselves when they can not run on an end-users graphics card.

Note: Support differs on the hardware basis; SSAO is anyway too expensive for any real use on mobile devices - so noone should bother thinking if it supported on this or that device.

Page last updated: 2011-03-30