Version: Unity 7.0 Alpha (7000.0)
Language : English
Introduction to screen space ambient occlusion in URP
Enable ambient occlusion in your project

Ambient occlusion modes in URP

The Universal Render Pipeline (URP) provides two ambient occlusionA method to approximate how much ambient light (light not coming from a specific direction) can hit a point on a surface.
See in Glossary
algorithms: Screen Space Ambient Occlusion (SSAO) and Ground Truth Ambient Occlusion (GTAO). You choose between them with the Mode property of the Screen Space Ambient Occlusion Volume Override.

SSAO

For each pixel, SSAO samples the area around it to estimate how much ambient light reaches that point.

At low quality settings, SSAO produces visible noise and graininess, which the Blur Quality property helps reduce.

Use SSAO if you need to preserve the exact look of a project made with an earlier URP version, or if GTAO is too slow on your target platform.

GTAO

GTAO is the default mode. For each pixel, it uses the depth buffer to measure how much of the ambient light nearby geometry blocks.

Compared with SSAO, GTAO produces more accurate contact shadows with less over-darkening. At low quality settings it produces a softer, weaker result rather than a noisy one.

GTAO also provides the Minimum Radius (Pixels) property. Distant objects cover fewer pixels on screen, which can make occlusion fade away on them. This property keeps occlusion visible by setting the smallest area, in pixels, that GTAO samples around each point.

GTAO execution paths

GTAO runs on one of two paths, which you select with the Use Compute Shader property:

  • The fragment path is the default. It uses the Sample Count property to determine how many samples to take.
  • The compute path uses a compute shader. It provides the Direction Count, Step Count and Spatial Filter properties, and it’s the only path that supports Temporal Accumulation.

The compute path requires compute shader support on the target platform. On platforms without that support, URP falls back to the fragment path and the compute-only properties have no effect. The Editor displays a warning when compute shaders are unavailable.

Recommended settings

Start with GTAO on every platform, and use the Quality property to suit your target platform:

Platform Mode Quality
Desktop and console GTAO High
Mobile and virtual reality (VR) GTAO Medium

If the preset in the table is too slow on your target platform, step down to the next one. The Low preset already enables Downsample. On the GTAO fragment path it also sets Sample Count to its lowest value; on the compute path it sets Direction Count to 1 and Step Count to 2. If the Low preset doesn’t give you the performance you need, do the following:

  • Reduce Radius to lower the amount of texture sampling.
  • Reduce Falloff Distance so URP skips occlusion on distant geometry.
  • In GTAO mode, consider turning off Use Compute Shader and Temporal Accumulation.
  • On mobile platforms that use tile-based rendering, enable After Opaque. This reduces accuracy, because URP applies the occlusion after it evaluates the shading model.

Limitations

Both modes are screen-space techniques, so they only account for occlusion from geometry that appears in the depth buffer. Occluders that are off-screen or hidden behind other surfaces don’t contribute, which can weaken or remove occlusion near the edges of the screen.

GTAO always uses the depth-normals prepass and applies its own filtering. As a result, the Depth Source, Normal Quality and Blur Quality properties apply to SSAO only and have no effect in GTAO mode.

Temporal Accumulation reuses data from previous frames, and relies on motion vectors to track how the camera and objects moved between them. Enabling it adds motion vector generation to the frame, which reduces performance. Fast camera or object movement can still introduce noise or ghosting.

Additional resources

Introduction to screen space ambient occlusion in URP
Enable ambient occlusion in your project