Ray-Traced Contact Shadows
Ray-Traced Contact Shadows is a ray tracing feature in the High Definition Render Pipeline (HDRP). It is an alternative to HDRP's Contact Shadow technique that uses a more accurate ray-traced solution that can use off-screen data.
Without Contact shadows
Contact shadows
Ray-traced contact shadows
For information about ray tracing in HDRP, and how to set up your HDRP Project to support ray tracing, see Getting started with ray tracing.
Using Ray-Traced Contact Shadows
Because this feature is an alternative to the contact shadows Volume Override, the initial setup is very similar.
- Enable contact shadows in your HDRP Asset.
- Enable contact shadows for your Cameras.
- Add the effect to a Volume in your Scene.
HDRP Asset setup
The HDRP Asset controls which features are available in your HDRP Project. To make HDRP support and allocate memory for contact Shadows:
- Click on your HDRP Asset in the Project window to view it in the Inspector.
- In the Lighting > Shadows section, enable Contact Shadows.
Camera setup
Cameras use Frame Settings to decide how to render the Scene. To enable contact shadows for your Cameras by default:
- Open the Project Settings window (menu: Edit > Project Settings), then select the HDRP Default Settings tab.
- Select Camera from the Default Frame Settings For drop-down.
- In the Lighting section, enable Contact Shadows.
All Cameras can now process contact shadows unless they use custom Frame Settings. If they do:
- In the Scene view or Hierarchy, select the Camera's GameObject to open it in the Inspector.
- In the Custom Frame Settings, navigate to the Lighting section and enable Contact Shadows.
Volume setup
Ray-Traced Contact Shadow uses the Volume framework, so to enable this feature and modify its properties, you need to add an Contact Shadow override to a Volume in your Scene. To do this:
- In the Scene or Hierarchy view, select a GameObject that contains a Volume component to view it in the Inspector.
- In the Inspector, navigate to Add Override > Lighting and click on Conact Shadows. HDRP now applies contact shadow to any Camera this Volume affects.
Light Setup
To make HDRP calculate, and use, Ray-Traced Contact Shadows, you need to enable them on a Light .
- In your Light component, go to Shadows > Contact Shadows and tick the Enable checkbox. This exposes the Ray Tracing property.
- Enable the Ray Tracing checkbox.