Skip to content

Consolidated ray tracing documentation to make blue book links point to reference documentaiton #2575

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ The **Ambient Occlusion** override is a real-time, full-screen lighting effect a

For information on how to use a Texture to specify ambient occlusion caused by details present in a GameObject's Material but not on it's surface geometry, see [Ambient Occlusion](Ambient-Occlusion.md).

HDRP implements [ray-traced ambient occlusion](Ray-Traced-Ambient-Occlusion.md) on top of this override. This means that the properties visible in the Inspector change depending on whether or not you enable ray tracing.

## Enabling Ambient Occlusion

[!include[](snippets/Volume-Override-Enable-Override.md)]

For this feature:
The property to enable in your HDRP Asset is: **Lighting > Screen Space Ambient Occlusion**.
The property to enable in your Frame Settings is: **Lighting > Screen Space Ambient Occlusion**.

## Using Ambient Occlusion

**Ambient Occlusion** uses the [Volume](Volumes.md) framework, so to enable and modify **Ambient Occlusion** properties, you must add an **Ambient Occlusion** override to a [Volume](Volumes.md) in your Scene. To add **Ambient Occlusion** to a Volume:
Expand All @@ -14,26 +24,53 @@ For information on how to use a Texture to specify ambient occlusion caused by d

## Properties

![](Images/OverrideAmbientOcclusion1.png)

[!include[](snippets/Volume-Override-Enable-Properties.md)]

The properties visible in the Inspector change depending on whether or not you enable ray tracing for this effect:

- To not use ray tracing, disable **Ray Tracing** in the Inspector and see [Screen-space](#screen-space) for the list of properties.
- To use ray tracing, enable **Ray Tracing** in the Inspector and see [Ray-traced](#ray-traced) for the list of properties.



### Screen-space

![](Images/OverrideAmbientOcclusion1.png)

| **Property** | **Description** |
| ---------------------------- | ------------------------------------------------------------ |
| **Ray Tracing** | Indicates whether HDRP uses ray tracing to calculate ambient occlusion. If you enable this property, it completely changes the implementation for this Volume override and exposes a new set of properties to control the ray-traced ambient occlusion.<br/>For information on ray-traced ambient occlusion, see [ray-traced ambient occlusion](Ray-Traced-Ambient-Occlusion.md).<br/>For information on the properties that control the ray-traced ambient occlusion, see the [Ray-traced](#ray-traced) properties section below. |
| **Intensity** | Use the slider to guide the intensity of the ambient occlusion. Higher values lead to darker results. HDRP uses this value as an exponent to evaluate a pixel's final value for ambient occlusion. |
| **Direct Lighting Strength** | Use this slider to change how much the occlusion affects direct diffuse lighting. |
| **Step Count** | Use the slider to set the number of steps HDRP takes to search for occluders. Increase this value to produce more precise results. This might produce a darker result as HDRP finds more occluders. |
| **Radius** | Use the slider to set the distance that HDRP searches around a point for occluders. Set a higher value to make ambient occlusion cover larger scale features. Be aware that a higher distance value often produces a lower quality result. **Note:** HDRP clamps the radius in screen space to the value you set in **Maximum Radius in Pixels**. |
| **Maximum Radius In Pixels** | Use the slider to set an upper limit, in pixels, for the area that HDRP searches for occluders. The numerical value assumes that you are using a resolution of 1920 x 1080. HDRP scales this value accordingly when you use a different resolution. Keep this value as low as possible in order to achieve good performance. |
| **Full Resolution** | Enable the checkbox to process the ambient occlusion algorithm in full resolution. This improves quality significantly but is a resource-intensive operation and has an impact on performance. Disable the checkbox to process the ambient occlusion algorithm at half the resolution your application runs at. This setting is disabled by default. |
| **Temporal Accumulation** | Enable the checkbox to accumulate the result of AO over time. This will lead to better quality, but it might result in artifacts like non instant convergence and ghosting. **Note:** This mode will not lead to good results if motion vectors are not available. |
| **Ghosting Reduction** | This is only available when Temporal Accumulation is enabled.<br />Moving this factor closer to 0 will increase the amount of accepted samples during temporal accumulation, increasing the ghosting, but reducing the temporal noise. Moving the value closer to 1 will reduce the ghosting, at expense of more visible temporal noise. |
| **Bilateral Aggressiveness** | This is only available when Temporal Accumulation is enabled.<br />Higher this value, the less lenient with depth differences the spatial filter is and therefore more likely is to reject samples that are at different depth values. Increasing this for could reduce white halos where AO should be around objects. |
| **Bilateral Upsample** | Enable the checkbox to upsample the low resolution AO through bilateral upsampling. This preserves sharp edges better, however it is slightly more expensive and might result is more visible aliasing. **Note:** This mode is available only when Full Resolution is set to false. |
| **Direction Count** | Determines how many directions are searched for occlusion, increasing this will impact performance considerably. **Note:** This mode is available only when Temporal Accumulation is set to false. |
| **Blur sharpness** | Determines the sharpness of the non-temporal blur. Higher values preserve sharp features better (with higher risk of noise), lower values have a softer look. **Note:** This mode is available only when Temporal Accumulation is set to false. |
| **Quality** | Specifies the preset HDRP uses to populate the values of the following nested properties. The options are:<br/>&#8226; **Low**: A preset that emphasizes performance over quality.<br/>&#8226; **Medium**: A preset that balances performance and quality.<br/>&#8226; **High**: A preset that emphasizes quality over performance.<br/>&#8226; **Custom**: Allows you to override each property individually. |
| - **Maximum Radius In Pixels** | Use the slider to set an upper limit, in pixels, for the area that HDRP searches for occluders. The numerical value assumes that you are using a resolution of 1920 x 1080. HDRP scales this value accordingly when you use a different resolution. Keep this value as low as possible in order to achieve good performance. |
| - **Full Resolution** | Enable the checkbox to process the ambient occlusion algorithm in full resolution. This improves quality significantly but is a resource-intensive operation and has an impact on performance. Disable the checkbox to process the ambient occlusion algorithm at half the resolution your application runs at. This setting is disabled by default. |
| - **Step Count** | The number of steps HDRP takes to search for occluders. Increase this value to produce more precise results. This often produces darker results because HDRP finds more occluders. |
| **Temporal Accumulation** | Indicates whether HDRP accumulates the result of ambient occlusion over time. This leads to better quality, but might result in artifacts like non-instant convergence and ghosting. **Note:** This mode does not produce good results if motion vectors are not available. |
| - **Direction Count** | Determines how many directions are searched for occlusion, increasing this will impact performance considerably.<br/>This property only appears if you disable **Temporal Accumulation**. |
| - **Blur sharpness** | Determines the sharpness of the non-temporal blur. Higher values preserve sharp features better (with higher risk of noise), lower values have a softer look.<br/>This property only appears if you disable **Temporal Accumulation**. |
| - **Bilateral Aggressiveness** | Higher this value, the less lenient with depth differences the spatial filter is and therefore more likely is to reject samples that are at different depth values. Increasing this for could reduce white halos where AO should be around objects.<br/>This property only appears if you enable **Temporal Accumulation**. |
| - **Ghosting Reduction** | Moving this factor closer to 0 will increase the amount of accepted samples during temporal accumulation, increasing the ghosting, but reducing the temporal noise. Moving the value closer to 1 will reduce the ghosting, at expense of more visible temporal noise.<br/>This property only appears if you enable **Temporal Accumulation**. |
| - **Bilateral Upsample** | Enable the checkbox to upsample the low resolution AO through bilateral upsampling. This preserves sharp edges better, however it is slightly more expensive and might result is more visible aliasing.<br/>This property only appears if you enable **Temporal Accumulation** and disable **Full Resolution**. |

### Ray-traced

![](Images/RayTracedAmbientOcclusion3.png)

| Property | Description |
| ---------------------------- | ------------------------------------------------------------ |
| **Intensity** | See **Intensity** in [Screen-space](#screen-space). |
| **Direct Lighting Strength** | See **Direct Lighting Strenght** in [Screen-space](#screen-space). |
| **LayerMask** | Defines the layers that HDRP processes this ray-traced effect for. |
| **Quality** | Specifies the preset HDRP uses to populate the values of the following nested properties. The options are:<br/>&#8226; **Low**: A preset that emphasizes performance over quality.<br/>&#8226; **Medium**: A preset that balances performance and quality.<br/>&#8226; **High**: A preset that emphasizes quality over performance.<br/>&#8226; **Custom**: Allows you to override each property individually. |
| - **Max Ray Length** | Controls the maximal ray length of the rays that HDRP uses for ray traced ambient occlusion. This allows you to have smaller scale, local, ambient occlusion. |
| - **Sample Count** | Controls the number of rays that HDRP uses per pixel, per frame. Increasing this value increases execution time linearly. |
| - **Denoise** | Enables the spatio-temporal filter that HDRP uses to remove noise from the ambient occlusion. |
| - - **Denoiser Radius** | Controls the radius of the spatio-temporal filter. A higher value reduces noise further. |

## Limitations

## Details
### Screen-space ambient occlusion

Ambient occlusion is a screen-space effect, so it only processes what is on the screen at a given point in time. This means that objects outside of the field of view cannot visually occlude objects in the view. You can sometimes see this on the edges of the screen.
A screen-space effect only processes what is on the screen at a given point in time. This means that objects outside of the field of view cannot visually occlude objects in the view. You can sometimes see this on the edges of the screen.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ The Contact Shadows [Volume Override](Volume-Components.md) specifies properties


## Enabling Contact Shadows
[!include[](snippets/Volume-Override-Enable.md)]
[!include[](snippets/Volume-Override-Enable-Override.md)]

For this feature:
The property to enable in your HDRP Asset is: **Lighting > Shadows > Use Contact Shadows**.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

The **Screen Space Illumination** (SSGI) override is a High Definition Render Pipeline (HDRP) feature that uses the depth and color buffer of the screen to calculate diffuse light bounces.

HDRP implements [ray-traced global illumination](Ray-Traced-Global-Illumination.md) on top of this override. This means that the properties visible in the Inspector change depending on whether or not you enable ray tracing.

![](Images/HDRPFeatures-SSGI.png)

## Enabling Screen Space Global Illumination
[!include[](Snippets/Volume-Override-Enable.md)]
[!include[](Snippets/Volume-Override-Enable-Override.md)]

For this feature:
The property to enable in your HDRP Asset is: **Lighting > Screen Space Global Illumination**.
Expand All @@ -23,10 +25,48 @@ HDRP uses the [Volume](Volumes.md) framework to calculate SSGI, so to enable and

[!include[](Snippets/Volume-Override-Enable-Properties.md)]

| **Property** | **Description** |
| ----------------------------- | ------------------------------------------------------------ |
| **Quality** | Specifies the overall quality of the effect. The higher the quality, the more resource-intensive the effect is to process.|
| **Full Resolution** | Toggles whether HDRP calculates SSGI at full resolution. |
| **Ray Steps** | The number of ray steps to use to calculate SSGI. If you set this to a higher value, the quality of the effect improves, however it is more resource intensive to process. |
| **Filter Radius** | The size of the filter use to smooth the effect after raymarching. Higher value mean blurrier result and is more resource intensive. |
| **Object Thickness** | Use the slider to control the thickness of the GameObjects on screen. Because the SSR algorithm can not distinguish thin GameObjects from thick ones, this property helps trace rays behind GameObjects. The algorithm applies this property to every GameObject uniformly. |
The properties visible in the Inspector change depending on whether or not you enable ray tracing for this effect:

- To not use ray tracing and instead use the screen-space global illumination solution, disable **Ray Tracing** in the Inspector and see [Screen-space](#screen-space) for the list of properties.

- To use ray tracing, enable **Ray Tracing** in the Inspector and see [Ray-traced](#ray-traced) for the list of properties.

### Screen-space

![](Images/Override-ScreenSpaceGlobalIllumination1.png)

| **Property** | **Description** |
| -------------------- | ------------------------------------------------------------ |
| **Enable** | Indicates whether HDRP processes SSGI for Cameras in the influence of this effect's Volume. |
| **Ray Tracing** | Indicates whether HDRP uses ray tracing to calculate global illumination. If you enable this property, it completely changes the implementation for this Volume override and exposes a new set of properties to control the ray-traced global illumination.<br/>For information on ray-traced global illumination, see [ray-traced global illumination](Ray-Traced-Global-Illumination.md).<br/>For information on the properties that control the ray-traced global illumination, see the [Ray-traced](#ray-traced) properties section below. |
| **Quality** | Specifies the overall quality of the effect. The higher the quality, the more resource-intensive the effect is to process. |
| **Full Resolution** | Toggles whether HDRP calculates SSGI at full resolution. |
| **Ray Steps** | The number of ray steps to use to calculate SSGI. If you set this to a higher value, the quality of the effect improves, however it is more resource intensive to process. |
| **Filter Radius** | The size of the filter use to smooth the effect after raymarching. Higher value mean blurrier result and is more resource intensive. |
| **Object Thickness** | Use the slider to control the thickness of the GameObjects on screen. Because the SSR algorithm can not distinguish thin GameObjects from thick ones, this property helps trace rays behind GameObjects. The algorithm applies this property to every GameObject uniformly. |

### Ray-traced

| Property | Description |
| ------------------------------ | ------------------------------------------------------------ |
| **Ray Tracing** | Enable this to make HDRP use ray tracing to evaluate indirect diffuse lighting. This makes extra properties available that you can use to adjust the quality of Ray-Traced Global Illumination. |
| **LayerMask** | Defines the layers that HDRP processes this ray-traced effect for. |
| **Mode** | Defines if HDRP should evaluate the effect in **Performance** or **Quality** mode.<br/>This property only appears if you select set **Supported Ray Tracing Mode** in your HDRP Asset to **Both**. |
| **Quality** | Specifies the preset HDRP uses to populate the values of the following nested properties. The options are:<br/>&#8226; **Low**: A preset that emphasizes performance over quality.<br/>&#8226; **Medium**: A preset that balances performance and quality.<br/>&#8226; **High**: A preset that emphasizes quality over performance.<br/>&#8226; **Custom**: Allows you to override each property individually.<br/>This property only appears if you set **Mode** to **Performance**. |
| **Max Ray Length** | Controls the maximal length of rays. The higher this value is, the more resource-intensive ray traced global illumination is. |
| **Clamp Value** | Set a value to control the threshold that HDRP uses to clamp the pre-exposed value. This reduces the range of values and makes the global illumination more stable to denoise, but reduces 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.<br/>This property only appears if you set **Mode** to **Performance**. |
| **Upscale Radius** | Controls the radius of the up-scaler that HDRP uses to build the GI. The larger the radius, the more neighbors HDRP uses to build the GI, the better the quality.<br/>This property only appears if you set **Mode** to **Performance**. |
| **Sample Count** | Controls the number of rays per pixel per frame. Increasing this value increases execution time linearly.<br/>This property only appears if you set **Mode** to **Quality**. |
| **Bounce Count** | Controls the number of bounces that global illumination rays can do. Increasing this value increases execution time exponentially.<br/>This property only appears if you set **Mode** to **Quality**. |
| **Denoise** | Enable this to enable the spatio-temporal filter that HDRP uses to remove noise from the Ray-Traced global illumination. |
| - **Half Resolution Denoiser** | Enable this feature to evaluate the spatio-temporal filter in half resolution. This decreases the resource intensity of denoising but reduces quality. |
| - **Denoiser Radius** | Set the radius of the spatio-temporal filter. |
| - **Second Denoiser Pass** | Enable this feature to process a second denoiser pass. This helps to remove noise from the effect. |


## Limitations

### Ray-traced global illumination

Currently, ray tracing in HDRP does not support [decals](decal.md). This means that ray-traced global illumination does not affect decals in your Scene.
Loading