Jump to content

Screen space ambient occlusion

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Stimpy77 (talk | contribs) at 05:12, 13 January 2011. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

SSAO component of typical game scene.

Screen Space Ambient Occlusion (SSAO) is a rendering technique for efficiently approximating the well-known computer graphics ambient occlusion effect in real time. It was used for the first time in a video game in the 2007 PC game Crysis made by Crytek.

The algorithm is implemented as a pixel shader, analyzing the scene depth buffer which is stored in a texture. For every pixel on the screen, the pixel shader samples the depth values around the current pixel and tries to compute the amount of occlusion from each of the sampled points. In its simplest implementation, the occlusion factor depends only on the depth difference between sampled point and current point.

Without additional smart solutions, such a brute force method would require about 200 texture reads per pixel for good visual quality. This is not acceptable for real-time rendering on modern graphics hardware. In order to get high quality results with far fewer reads, sampling is performed using a randomly-rotated kernel. The kernel orientation is repeated every N screen pixels in order to have only high-frequency noise in the final picture. In the end this high frequency noise is greatly removed by a NxN post-process blurring step taking into account depth discontinuities (using methods such as comparing adjacent normals and depths). Such a solution allows a reduction in the number of depth samples per pixel to about 16 or less while maintaining a high quality result, and allows the use of SSAO in real-time applications like computer games.

Compared to other ambient occlusion solutions, SSAO has the following advantages:

  • Independent from scene complexity.
  • No data pre-processing needed, no loading time and no memory allocations in system memory.
  • Works with dynamic scenes.
  • Works in the same consistent way for every pixel on the screen.
  • No CPU usage – it can be executed completely on the GPU.
  • May be easily integrated into any modern graphics pipeline.

Of course, it has its disadvantages, as well:

  • Rather local and in many cases view-dependent, as it is dependent on adjacent texel depths which may be generated by any geometry whatsoever.
  • Hard to correctly smooth/blur out the noise without interfering with depth discontinuities, such as object edges (the occlusion should not "bleed" onto objects).

Games using SSAO


See also

References