Ambient occlusion
The High Definition Render Pipeline (HDRP) uses ambient occlusion to approximate ambient light on a GameObject’s surface that has been cast by details present in the Material but not the surface geometry. Since these details don't exist on the model, you must provide an ambient occlusion Texture for HDRP to occlude indirect lighting (lighting from Lightmaps, Light Probes or Ambient Light Probes). HDRP also uses the ambient occlusion Texture to calculate specular occlusion. It calculates specular occlusion from the Camera's view vector and the ambient occlusion Texture to dim reflections in cavities.
To generate an ambient occlusion Texture, you can use external software like:
- xNormal
- Substance Designer or Painter
- Knald
When authoring ambient occlusion Textures, be aware that a value of 0 specifies an area that's fully occluded and a value of 1 specifies an area that's fully visible.
When you create the Texture, you must apply it to a Material. To do this, you must use the green channel of a mask map.
Note: Ambient occlusion in a Lit Shader using deferred rendering affects emission due to a technical constraint. Lit Shaders that use forward rendering don't have this constraint and don't affect emission.
Properties
The ambient occlusion properties are in the Surface Inputs drop-down of your Shader.
Property | Description |
---|---|
Mask Map - Green channel | Assign the ambient occlusion map in the green channel of the Mask Map Texture. HDRP uses the green channel of this map to calculate ambient occlusion. |
Ambient Occlusion Remapping | Remaps the ambient occlusion map in the green channel of the Mask Map between the minimum and maximum values you define on the slider. These values are between 0 and 1. • Drag the left handle to the right to make the ambient occlusion more subtle. • Drag the right handle to the left to apply ambient occlusion to the whole Material. This is useful when the GameObject this Material is on is occluded by a dynamic GameObject. This property only appears when you assign a Texture to the Mask Map. |