Screen space ambient occlusion (SSAO)
The Screen Space Ambient Occlusion (SSAO) volume override simulates ambient occlusion in real-time.
A single-channel screen space ambient occlusion texture of a gothic corridor. The scene is white with shades of grey representing corners and crevices.
For each frame, SSAO creates a texture containing occluded areas in the camera view, which HDRP uses to reduce indirect lighting in those areas.
SSAO doesn't affect direct lighting, or the indirect light from Reflection Probes.
A screen-space effect only processes what's on-screen, so objects outside the camera view don't occlude objects in the camera view. You can sometimes see this at the edges of the screen. To include off-screen objects for better results, enable Ray-traced ambient occlusion instead.
Enable screen space ambient occlusion
Follow these steps:
Enable screen space ambient occlusion in your project.
To use this feature in your Scene, you must first enable it for your project and then enable it for your Cameras. To enable features in your project, you use the HDRP Asset and to enable features for your Cameras, you use Frame Settings. You can enable features either for all Cameras, using the Default Frame Settings, or for specific Cameras, by overriding each Camera's individual Frame Settings.
- To enable SSAO in your HDRP Asset, go to Lighting > Screen Space Ambient Occlusion.
- To enable SSAO in your Frame Settings, go to Edit > Project Settings > Graphics > Pipeline Specific Settings > HDRP > Frame Settings (Default Values) > Camera > Lighting > Screen Space Ambient Occlusion.
Add a volume component to any GameObject in your scene.
Select the GameObject, then in the Inspector window select Add Override > Lighting > Ambient Occlusion.
HDRP now applies screen space ambient occlusion to any camera this volume affects.
To access and control the volume override at runtime, refer to Volume scripting API.