Skip to main content
Back to the graphics atlas
Rendering pipelineLighting & visibility Technique Advanced

Screen-Space Ambient Occlusion (SSAO)

Approximate local ambient shadowing from the depth and normal buffers so creases and contact areas feel less flat.

Lighting & visibility is nested under Rendering pipeline , so the broader pipeline usually still applies here.

graphicslightingambient-occlusionscreen-space

Interactive playground

Tweak the operator or scene live so the article connects to an immediate visual result.

SSAO

Sample nearby depth to estimate how enclosed a visible point feels, then darken it to suggest ambient occlusion.

Depth buffer

Scene view

Occlusion estimate

Result view

Larger radii spread the effect farther away from corners and contacts, but also make it more approximate.

Family

Rendering pipeline -> Lighting & visibility

Shadowing, occlusion, and how scene depth influences shading decisions.

Builds on

2 topics

Read these first if you want the surrounding pipeline context.

Unlocks

1 next topic

Use these follow-ups when you want to keep turning the image-processing pipeline forward.

Learning paths

1

This topic appears in curated graphics progressions so the next step is obvious.

Choose this over that

Ambient occlusion vs hard shadowing

SSAO is a screen-space shading hint, not a true replacement for shadow mapping or primary depth testing.

Current topic

Screen-Space Ambient Occlusion (SSAO)

Choose this when: You want local crevice darkening from screen-space depth alone.

Choose something else when: Directional light visibility or temporal stability matters more.

Lighting & visibility Open topic

Shadow Mapping

Choose this when: You need light-direction-aware shadows rather than contact-style ambient darkening.

Choose something else when: The scene only needs a cheap local occlusion cue.

Post-processing Open topic

Temporal Anti-Aliasing (TAA)

Choose this when: The main artifact is frame-to-frame shimmer, not missing ambient shading.

Choose something else when: Lighting depth cues are still the missing effect.

Problem

Even with direct lighting, scenes can feel flat because corners, cracks, and contact regions miss the subtle darkening that real indirect occlusion would create.

Intuition

SSAO samples the nearby depth or geometry configuration around each visible pixel and estimates how blocked the hemisphere is. More nearby blockers imply less ambient light should reach that pixel.

Core idea

  • Start from a depth buffer and often a normal buffer.
  • Sample nearby points around each pixel in screen space.
  • Estimate how much surrounding geometry occludes the local hemisphere.
  • Darken the pixel proportionally and usually blur or stabilize the result afterward.

Worked example

A box sitting on a floor looks less floaty once the contact region darkens slightly. SSAO produces that contact shadow feel even without tracing true global illumination.

Complexity

The effect cost depends on sample count, blur passes, and resolution. It is still usually much cheaper than full physically based global illumination.

When to choose it

  • Choose it when you want cheap local ambient depth cues.
  • Choose shadow mapping when you need directional visibility from a particular light source.
  • Use TAA or similar stabilization when the raw SSAO result flickers under motion.

Key takeaways

  • SSAO is an approximation based on already visible geometry in screen space.
  • It enhances contact and crevice shading rather than replacing real shadowing.
  • Noise, blur, and temporal stabilization are common practical concerns.
  • It reuses depth information for lighting rather than primary visibility.

Practice ideas

  • Visualize the occlusion buffer separately from the lit frame.
  • Compare low-sample and high-sample SSAO and inspect the noise difference.
  • Apply temporal stabilization or blur and note which artifacts remain.

Relation to other topics

  • The z-buffer supplies the geometric depth structure SSAO relies on.
  • Shadow mapping answers light visibility from a source; SSAO approximates ambient occlusion from nearby screen-space geometry.
  • TAA often appears later to stabilize noisy full-screen effects such as SSAO.

Build on these first

These topics supply the mental model or preceding stage that this page assumes.

What this enables

Once the current operator feels natural, these are the most useful follow-up jumps.

Related directions

These topics live nearby conceptually, even if they are not strict prerequisites.

More from Lighting & visibility

Stay in the same family when you want parallel operators built from the same mental model.

Paths that include this topic

Follow one of these sequences if you want a guided next step instead of open-ended browsing.

Raster pipeline

Follow the classic rendering path from clipping and rasterization into visibility, shadows, occlusion, and temporal cleanup.

From the blog

Pair the graphics atlas with recent writing from the broader site whenever you want a wider engineering lens.