Use the shadows volume component override
The Shadows Volume component override controls the maximum distance at which HDRP renders shadow cascades and shadows from punctual lights. It uses cascade splits to control the quality of shadows cast by Directional Lights over distance from the Camera.
To learn about the Shadows volume component properties, refer to Shadows volume override reference.
Create a shadow volume override
Shadows uses the Volume framework, so to enable and modify Shadows properties, add a Shadows override to a Volume in your Scene.
The Shadows override comes as default when you create a Scene Settings GameObject (Menu: GameObject > Rendering > Scene Settings). You can also manually add a Shadows override to any Volume. To add Shadows to a Volume:
- In the Scene or Hierarchy view, select a GameObject that contains a Volume component to view it in the Inspector.
- In the Inspector, go to Add Override > Shadowing and select Shadows. You can now use the Shadows override to alter shadow settings for this Volume.
API
To access and control this override at runtime, use the Volume scripting API. Because of how the Volume system works, you edit properties in a different way to standard Unity components. There are also other nuances to be aware of too, such as each property has an overrideState. This indicates to the Volume system whether to use the property value you set, or use the default value stored in the Volume Profile. For information on how to use the API correctly, see Volume scripting API.