Screen Space Ambient Occlusion
From Wikipedia, the free encyclopedia
This article does not cite any references or sources. (January 2008) Please help improve this article by adding citations to reliable sources. Unverifiable material may be challenged and removed. |
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 the 2007 PC game Crysis.[citation needed]
The algorithm is executed purely on the computer's GPU and 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 amount of occlusion from each of 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 4x4 screen pixels in order to have only high-frequency noise in the final picture. In the end this high frequency noise is completely removed by a 4x4 post-process blurring step taking into account depth discontinuity. Such a solution allows a reduction in the number of depth samples per pixel to 16 while maintaining a high quality result, and basically allows the use of SSAO in real-time applications like computer games.
Compared to other ambient occlusion solutions, SSAO has 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 is executed completely on the GPU.
- May be easily integrated into any modern graphics pipeline.