Ray-Traced Reflections
Ray-Traced Reflections is a ray tracing feature in the High Definition Render Pipeline (HDRP). It is an alternative, more accurate, ray-traced solution to Screen Space Reflection that can make use of off screen data.
Screen-space reflections
Ray-traced reflections
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 Reflections
Because this feature replaces the Screen Space Reflection Volume Override, the initial setup is very similar.
- Enable screen space reflection in your HDRP Asset.
- Enable screen space reflection for your Cameras.
- Add the effect to a Volume in your Scene.
HDRP Asset setup
- Click on your HDRP Asset in the Project window to view it in the Inspector.
- In the Lighting section, enable Screen Space Reflection.
Camera setup
Cameras use Frame Settings to decide how to render the Scene. To enable screen space reflection 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 Screen Space Reflection.
All Cameras can now process screen space reflection 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 Screen Space Reflection.
Volume setup
Ray-Traced Reflections uses the Volume framework, so to enable this feature, and modify its properties, you need to add a Screen Space Reflection 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 Screen Space Reflection. HDRP now applies screen space reflection to any Camera this Volume affects.
- In the Inspector for the Screen Space Reflection Volume Override, enable Ray Tracing. HDRP now uses ray tracing to calculate reflections. If you do not see the Ray Tracing option, make sure your HDRP Project supports ray tracing. For information on setting up ray tracing in HDRP, see Getting started with ray tracing.
Properties
Alongside the standard properties, Unity exposes extra properties depending on the ray tracing tier your HDRP Project is using. For information on what each tier does, and how to select a tier for your HDRP Project, see gettings started with ray tracing.
Shared
Property | Description |
---|---|
Ray Tracing | Makes HDRP use ray tracing to process screen-space reflections. Enabling this exposes properties that you can use to adjust the quality of ray-traced reflections. |
Minimum Smoothness | Controls the minimum smoothness value for a pixel at which HDRP processes ray-traced reflections. If the smoothness value of the pixel is lower than this value, HDRP falls back to the next available reflection method in the reflection hierarchy. |
Smoothness Fade Start | This feature has not been implemented yet and currently does nothing. Ray tracing in HDRP is experimental so some features have not been implemented yet. |
Reflect Sky | Enable this feature to specify to HDRP that it should use the sky as a fall-back for ray-traced reflections when a ray doesn't find an intersection. |
LayerMask | Defines the layers that HDRP processes this ray-traced effect for. |
Ray Length | Controls the length of the rays that HDRP uses for ray tracing. If a ray doesn't find an intersection, then the ray returns the color of the sky if Reflect Sky is enabled, or black if not. |
Clamp Value | Controls the threshold that HDRP uses to clamp the pre-exposed value. This reduces the range of values and makes the reflections more stable to denoise, but reduces quality. |
Denoise | Enables the spatio-temporal filter that HDRP uses to remove noise from the reflections. |
- Denoiser Radius | Controls the radius of the spatio-temporal filter. Increasing this value results in a more blurry result and a higher execution time. |
Tier 1
Property | Description |
---|---|
Upscale Radius | Controls the radius of the up-scaler that HDRP uses to build the reflection. The larger the radius, the more neighbors HDRP uses to build the reflection, the better the quality. |
Full Resolution | Enable this feature to increase the ray budget to one ray per pixel, per frame. Disable this feature to decrease the ray budget to one ray per four pixels, per frame. |
Deferred Mode | Enable this feature to make HDRP evaluate this as a deferred effect. This significantly improves performance, but can reduce the visual fidelity. |
Ray Binning | Enable this feature to "sort" rays to make them more coherent and reduce the resource intensity of this effect. |
Tier 2
When using ray tracing tier 2, there are extra properties that you can use to customize the quality of this effect.
Property | Description |
---|---|
Sample Count | Controls the number of rays per pixel per frame. Increasing this value increases execution time linearly. |
Bounce Count | Controls the number of bounces that reflection rays can do. Increasing this value increases execution time exponentially. |