In this lesson, you will learn how to leverage Screen Space Ambient Occlusion (SSAO) to ground your objects and bridge the gap between static geometry and realistic light interaction.
The Physics of Occlusion
In a real-world environment, light struggles to reach crevices, corners, and areas where objects meet the ground. These localized areas of darkness are called "ambient occlusion." Without it, your 3D models often appear to "float" above the floor because the contact point between the object and the surface lacks the soft, natural shadow that physics dictates should be there.
SSAO is a post-processing technique that calculates how much a point on a surface is blocked by nearby geometry. By analyzing the depth buffer, Unreal Engine approximates these occluded areas, injecting soft, realistic shadows exactly where they are needed most.
Refining the Effect
You can control this in your Post Process Volume. Under the Ambient Occlusion settings, pay close attention to three specific parameters:
- Intensity: Controls the darkness of the occlusion. Keep this subtle; over-cranking it can create artificial-looking "halos" around objects.
- Radius: Determines how far the occlusion effect spreads from the object’s contact point. A tighter radius is often better for micro-detail, while a larger radius adds broad, soft depth to corners.
- Exponent: Adjusts the falloff. A higher exponent makes the shadows tighter and more concentrated, which is excellent for sharpening the ground-contact of small props.
For a balanced look, you can also inject custom occlusion into your shaders by modulating the Ambient Occlusion input in your Master Material. While SSAO is a global screen-space effect, you can use vertex colors or small baked textures to drive the Ambient Occlusion pin, giving you granular control over where your materials reject global light:
// Example of blending baked AO into a material expression
float3 BaseAO = TextureSample(AOTexture, UVs);
return lerp(1.0, BaseAO, OcclusionIntensity);
By combining global SSAO for depth and material-based AO for texture detail, you ensure that no object in your scene feels disconnected from the world around it.
Key Takeaway: Screen Space Ambient Occlusion provides the vital "contact" shadows necessary to ground objects in your scene, turning isolated models into a cohesive, physically grounded environment.