Rendering

What Is SSAO? Screen Space Ambient Occlusion Explained

SSAO adds soft contact shadows to real-time graphics using only on-screen depth data. Learn how it works, its artifacts, and how it compares to HBAO+, HDAO and GTAO.

On this page
  1. SSAO in one sentence
  2. What ambient occlusion is
  3. How SSAO works step by step
  4. Why “screen space” matters: strengths and artifacts
  5. SSAO vs HBAO+, HDAO, GTAO and ray-traced AO
  6. Does SSAO increase performance?
  7. What ambient occlusion does in games
  8. Ambient occlusion in Blender and offline rendering

SSAO in one sentence

SSAO (screen space ambient occlusion) is a real-time graphics technique that approximates the soft shadows that appear in corners, creases and places where objects meet, using only the depth information of what’s currently on screen. Crytek introduced it in the 2007 game Crysis, and variants of it have been standard in game engines ever since.

To see why it’s useful, it helps to understand ambient occlusion first.

What ambient occlusion is

In the real world, light arrives at a surface from every direction: from the sky, from walls, from the floor. A point out in the open receives light from a wide range of directions. A point tucked into a corner, or under a table, has much of its surroundings blocked, so it receives less of that ambient light and looks darker.

Ambient occlusion (AO) measures how much of a point’s surroundings are blocked by nearby geometry, then darkens the point accordingly. It doesn’t care where specific lights are; it’s about how exposed a point is.

Examples of ambient occlusion you can see around you:

  • The soft darkening where a wall meets the floor or ceiling
  • The shadow under a sofa or a parked car, even on an overcast day
  • The darker folds in a crumpled sheet or a pair of jeans
  • The gaps between keys on a keyboard, or between your fingers
  • Cracks in brickwork and the grooves in wood panelling

Without AO, objects in a game often look like they’re floating, because the subtle contact shadows that anchor them to surfaces are missing.

How SSAO works step by step

Calculating true ambient occlusion means casting rays from every point in many directions and checking what they hit. That’s too slow for older real-time hardware. SSAO’s shortcut is to work entirely in screen space, using the image the GPU has already rasterized.

  1. Render depth (and usually normals). The engine already has a depth buffer, the distance to the nearest surface at every pixel. Most modern SSAO implementations also use a normal buffer.
  2. Sample around each pixel. For each pixel, the shader takes a set of sample points in a small hemisphere oriented along the surface normal. The original Crysis approach used a sphere, which caused flat surfaces to darken.
  3. Compare depths. Each sample point is projected back onto the screen and its depth compared against the depth buffer. If the stored depth is closer to the camera than the sample, something is in the way, and that sample counts as occluded.
  4. Range check. Samples where the blocking surface is far away in depth are ignored or weakened. Without this, a character in front of a distant wall would wrongly darken the wall around their outline.
  5. Add noise, then blur. Using lots of samples per pixel is expensive, so implementations use few samples, randomly rotated per pixel with a small noise texture. That creates a grainy pattern, which a blur pass then smooths, ideally a depth-aware blur that doesn’t smear across edges.
  6. Apply the result. The final AO value, between 0 and 1, darkens the ambient or indirect lighting at each pixel.

LearnOpenGL’s SSAO tutorial is a good hands-on reference if you want to implement this yourself.

Why “screen space” matters: strengths and artifacts

Strengths:

  • Cost depends on resolution, not scene complexity. A million-polygon scene costs about the same as a simple one.
  • Works with moving objects. Nothing is baked in advance, so characters and props get contact shadows automatically.
  • Easy to add to an existing rasterized renderer.

Weaknesses, all caused by the fact that SSAO only knows what’s visible on screen:

  • Missing occluders. Geometry that’s off-screen, or hidden behind something closer, can’t cast occlusion. AO near the edges of the screen may fade or change as you turn the camera.
  • Halos. Dark or light outlines can appear around characters and foreground objects against distant backgrounds.
  • Noise and shimmering. With too few samples or a weak blur, you can see grain or flickering, especially in motion.
  • Not physically accurate. It’s a stylised darkening, not real light transport, so it can over-darken areas that would actually receive light.

SSAO vs HBAO+, HDAO, GTAO and ray-traced AO

Many games give you several AO options. They’re mostly variations on the same screen-space idea with different quality and cost trade-offs:

Technique Who / where How it differs Relative quality Relative cost
SSAO Crytek, 2007; many engines Depth comparisons in a sphere or hemisphere Basic Low
HBAO / HBAO+ NVIDIA Searches along screen-space directions for the “horizon” of occluding geometry Higher, more defined Moderate
HDAO AMD Higher-sample, higher-detail screen-space AO Higher Moderate–high
GTAO Activision research, 2016 Horizon-based, designed to match ground-truth AO more closely High Moderate
RTAO (ray-traced AO) DXR / Vulkan RT hardware Casts real rays, so off-screen geometry counts Highest High

What’s better, SSAO or HDAO? Generally HDAO and HBAO+ give more detailed, better-grounded shadows than basic SSAO, at a higher performance cost. The actual result depends heavily on each game’s implementation. Some games’ SSAO looks better than another game’s HBAO+. Compare them in a scene with lots of corners and foliage and see which you prefer at an acceptable frame rate.

Does SSAO increase performance?

No. SSAO costs performance; it doesn’t improve it. It’s an extra rendering pass that samples the depth buffer many times per pixel. The cost scales with screen resolution and sample count, which is why many games render AO at half resolution and upscale it.

The hit is usually modest compared with effects like ray-traced reflections or shadows, but it can be noticeable on older or integrated GPUs. If you need frames, turning AO down or off is a reasonable setting to try. Higher-quality options like HBAO+ and HDAO usually cost more than basic SSAO, and ray-traced AO costs the most.

What ambient occlusion does in games

In games, AO mostly does three things:

  • Grounds objects. Contact shadows make characters, furniture and vehicles look like they’re sitting on surfaces rather than floating.
  • Adds depth and readability. Corners, doorways and the details of a model become easier to read.
  • Fills in for missing indirect shadowing. Many games light scenes with baked or probe-based indirect light that doesn’t capture small-scale shadowing. AO adds it back.

Turning AO off usually makes a game look flatter and slightly “gamey”, especially in indoor and foliage-heavy scenes. In games with fully ray-traced or path-traced lighting, a separate AO effect matters less, because the lighting itself already accounts for occlusion.

Ambient occlusion in Blender and offline rendering

Offline renderers have their own forms of AO:

  • Blender Cycles is a path tracer, so occlusion emerges naturally from light bouncing. You don’t need AO for realism. Cycles still offers an Ambient Occlusion render pass and an Ambient Occlusion shader node, which are useful for compositing, procedural dirt and edge-wear masks.
  • Blender EEVEE, being rasterization-based, uses screen-space techniques for occlusion and related effects. That means it shares some of SSAO’s limitations, such as missing occlusion from off-screen geometry. See our Cycles vs EEVEE comparison for more on what that means in practice.
  • Baked AO maps are common for game assets. AO is precomputed into a texture map in Blender, Substance Painter or similar tools, then multiplied into the material, so no runtime cost is needed for small details.

For the bigger picture of how screen-space tricks relate to ray and path tracing, see our explainer on ray tracing vs rasterization vs path tracing.

The complete guide to rendering

3D Rendering Software: The Best Rendering Tools Compared
Read the guide

Keep exploring

Guides from other topics

All topics →