Screen Space Ambient Occlusion
   HOME

TheInfoList



OR:

Screen space ambient occlusion (SSAO) is a
computer graphics Computer graphics deals with generating images with the aid of computers. Today, computer graphics is a core technology in digital photography, film, video games, cell phone and computer displays, and many specialized applications. A great de ...
technique for efficiently approximating the
ambient occlusion In 3D computer graphics, modeling, and animation, ambient occlusion is a shading and rendering technique used to calculate how exposed each point in a scene is to ambient lighting. For example, the interior of a tube is typically more occluded ...
effect in real time. It was developed by Vladimir Kajalin while working at
Crytek Crytek GmbH is a German video game developer and software developer based in Frankfurt. Founded by the Yerli brothers in Coburg in 1999 and moved to Frankfurt in 2006, Crytek also operates further studios in Kyiv, Ukraine and Istanbul, Turkey. ...
and was used for the first time in 2007 by the video game ''
Crysis ''Crysis'' is a first-person shooter video game series created by Crytek. The series revolves around a group of military protagonists with " nanosuits", technologically advanced suits of armor that give them enhanced physical strength, speed, ...
'', also developed by Crytek.


Implementation

The algorithm is implemented as a
pixel shader In computer graphics, a shader is a computer program that calculates the appropriate levels of light, darkness, and color during the rendering of a 3D scene - a process known as ''shading''. Shaders have evolved to perform a variety of spec ...
, analyzing the scene
depth buffer A depth buffer, also known as a z-buffer, is a type of data buffer used in computer graphics to represent depth information of objects in 3D space from a particular perspective. Depth buffers are an aid to rendering a scene to ensure that the ...
which is stored in a texture. For every
pixel In digital imaging, a pixel (abbreviated px), pel, or picture element is the smallest addressable element in a raster image, or the smallest point in an all points addressable display device. In most digital display devices, pixels are the smal ...
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 Real-time computer graphics or real-time rendering is the sub-field of computer graphics focused on producing and analyzing images in real time. The term can refer to anything from rendering an application's graphical user interface ( GUI) to ...
on current graphics hardware. In order to get high quality results with far fewer reads, sampling is performed using a randomly rotated
kernel Kernel may refer to: Computing * Kernel (operating system), the central component of most operating systems * Kernel (image processing), a matrix used for image convolution * Compute kernel, in GPGPU programming * Kernel method, in machine learnin ...
. 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 ''N''x''N'' 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 fewer while maintaining a high quality result, and allows the use of SSAO in soft real-time applications like computer games. Compared to other
ambient occlusion In 3D computer graphics, modeling, and animation, ambient occlusion is a shading and rendering technique used to calculate how exposed each point in a scene is to ambient lighting. For example, the interior of a tube is typically more occluded ...
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 A graphics processing unit (GPU) is a specialized electronic circuit designed to manipulate and alter memory to accelerate the creation of images in a frame buffer intended for output to a display device. GPUs are used in embedded systems, mobi ...
. * May be easily integrated into any modern
graphics pipeline In computer graphics, a computer graphics pipeline, rendering pipeline or simply graphics pipeline, is a conceptual model that describes what steps a graphics system needs to perform to Rendering (computer graphics), render a ...
. SSAO also has the following disadvantages: * 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).


See also

*
Screen space directional occlusion Screen space directional occlusion (SSDO) is a computer graphics technique enhancing screen space ambient occlusion (SSAO) by taking direction into account to sample the ambient light (both the light coming directly at an object, as well as the l ...
(SSDO)


References

{{reflist


External links


Finding Next Gen – CryEngine 2

Video showing SSAO in action

Image Enhancement by Unsharp Masking the Depth Buffer

Hardware Accelerated Ambient Occlusion Techniques on GPUs



Real-Time Depth Buffer Based Ambient Occlusion

Source code of SSAO shader used in Crysis

Approximating Dynamic Global Illumination in Image Space

Accumulative Screen Space Ambient Occlusion





SSAO Shader ( Russian )

SSAO Tutorial, extension of the technique used in Crysis
Shading Computer graphics 3D computer graphics Global illumination algorithms