Screen space ambient occlusion (SSAO) is a
computer graphics
Computer graphics deals with generating images and art with the aid of computers. Computer graphics is a core technology in digital photography, film, video games, digital art, cell phone and computer displays, and many specialized applications. ...
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 occlude ...
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 operates additional studios in Kyiv, Ukraine and Istanbul, Turkey. It ...
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 s ...
, analyzing the scene
depth buffer
A z-buffer, also known as a depth buffer, is a type of data buffer used in computer graphics to store the depth information of fragments. The values stored represent the distance to the camera, with 0 being the closest. The encoding scheme may ...
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 graphics, raster image, or the smallest addressable element in a dot matrix display device. In most digital display devices, p ...
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 occlude ...
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
A central processing unit (CPU), also called a central processor, main processor, or just processor, is the primary processor in a given computer. Its electronic circuitry executes instructions of a computer program, such as arithmetic, log ...
usage – it can be executed completely on the
GPU
A graphics processing unit (GPU) is a specialized electronic circuit designed for digital image processing and to accelerate computer graphics, being present either as a discrete video card or embedded on motherboards, mobile phones, personal ...
.
* May be easily integrated into any modern
graphics pipeline
The computer graphics pipeline, also known as the rendering pipeline, or graphics pipeline, is a framework within computer graphics that outlines the necessary procedures for transforming a three-dimensional (3D) scene into a two-dimensional (2 ...
.
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 (SSDO)
References
{{reflist
External links
Finding Next Gen – CryEngine 2Video showing SSAO in actionImage Enhancement by Unsharp Masking the Depth BufferHardware Accelerated Ambient Occlusion Techniques on GPUsReal-Time Depth Buffer Based Ambient OcclusionSource code of SSAO shader used in CrysisApproximating Dynamic Global Illumination in Image SpaceAccumulative Screen Space Ambient OcclusionSSAO Shader ( Russian )SSAO Tutorial, extension of the technique used in Crysis
Shading
Computer graphics
3D computer graphics
Global illumination algorithms