Skip to content

[HDRP] backport misc PRs #6738

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
merged 15 commits into from
Jan 13, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ public ComputeBufferDesc GetComputeBufferDesc(in ComputeBufferHandle computeBuff
public RenderGraphExecution RecordAndExecute(in RenderGraphParameters parameters)
{
m_CurrentFrameIndex = parameters.currentFrameIndex;
m_CurrentExecutionName = parameters.executionName;
m_CurrentExecutionName = parameters.executionName != null ? parameters.executionName : "RenderGraphExecution";
m_HasRenderGraphBegun = true;

m_Resources.BeginRenderGraph(m_ExecutionCount++);
Expand Down
4 changes: 4 additions & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed misc shader warnings.
- Fixed timeline not updating PBR HDAdditionalLightData parameters properly.
- Fixed Correlated Color Temperature not being applied in Player builds for Enlighten realtime GI lights (case 1370438);
- Fixed Tile/Cluster Debug in the Rendering Debugger for Decal and Local Volumetric Fog
- Fixed NeedMotionVectorForTransparent checking the wrong flag.
- Fixed rendering in the editor when an incompatible API is added (case 1384634).
- Fixed a crash with render graph viewer when render graph is not provided with an execution name.

## [12.1.3] - 2021-11-17

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Frame Settings

Frame Settings are settings HDRP uses to render Cameras, real-time, baked, and custom reflections. You can set the default values for Frame Settings for each of these three individually from within the [HDRP Global Settings](Default-Settings-Window.md) tab (menu: **Edit > Project Settings > Graphics > HDRP Settings**).
Frame Settings are settings HDRP uses to render Cameras, real-time, baked, and custom reflections. You can set the default values for Frame Settings for each of these three individually from within the [HDRP Global Settings](Default-Settings-Window.md) tab (menu: **Edit** > **Project Settings** > **Graphics > HDRP Global Settings**).

![](Images/FrameSettings1.png)

Expand Down
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.
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 @@ -18,40 +18,43 @@ To create Local Volumetric Fog, right click in the Hierarchy and select __Volume

| Property | Description |
| :--------------------------- | :----------------------------------------------------------- |
| **Single Scattering Albedo** | Sets the fog color. Volumetric Fog tints lighting, so the fog scatters light to this color. It only tints lighting emitted by Lights behind or within the fog. This means that it does not tint lighting that reflects off GameObjects behind or within the fog - reflected lighting only gets dimmer (fades to black) as fog density increases. For example, if you shine a Light at a white wall behind fog with red Single Scattering Albedo, the fog looks red. If you shine a Light at a white wall and view it from the other side of the fog, the fog darkens the light but doesn’t tint it red. |
| **Single Scattering Albedo** | Sets the fog color.<br/>Volumetric Fog tints lighting as the light scatters to appear this color. It only tints lighting emitted by Lights behind or within the fog. This means that it does not tint lighting that reflects off GameObjects behind or within the fog. Reflected lighting gets dimmer (fades to black) as fog density increases.<br/>For example, if you shine a Light at a white wall behind fog with red Single Scattering Albedo, the fog looks red. If you shine a Light at a white wall and view it from the other side of the fog, the fog darkens the light but doesn’t tint it red. |
| **Fog Distance** | Controls the density at the base of the fog and determines how far you can see through the fog in meters. At this distance, the fog has absorbed and out-scattered 63% of background light. |
| **Size** | Controls the dimensions of the Volume. |
| **Per Axis Control** | Enable this to control blend distance per axis instead of globally. |
| **Blend Distance** | Blend Distance creates a fade from the fog level in the Volume to the fog level outside it. This is not a percentage, it is the absolute distance from the edge of the Volume bounds, defined by the Size property, where the fade starts. Unity clamps this value between 0 and half of the lowest axis value in the Size property. If you use the Normal tab, you can alter a single float value named Blend Distance, which gives a uniform fade in every direction. If you open the Advanced tab, you can use two fades per axis, one for each direction. For example, on the x-axis you could have one for left-to-right and one for right-to-left. Setting the distance to 0 hides the fade, while setting the distance to 1 creates a fade. |
| **Per Axis Control** | Enable this to control blend distance per axis instead of globally. |
| **Blend Distance** | Blend Distance creates a fade from the fog level in the Volume to the fog level outside it. <br/>This value indicates the absolute distance from the edge of the Volume bounds, defined by the Size property, where the fade starts.<br/>Unity clamps this value between 0 and half of the lowest axis value in the Size property.<br/>If you use the **Normal** tab, you can alter a single float value named Blend Distance, which gives a uniform fade in every direction. If you open the **Advanced** tab, you can use two fades per axis, one for each direction. For example, on the X-axis you could have one for left-to-right and one for right-to-left.<br/>A value of 0 hides the fade, and a value of 1 creates a fade. |
| **Falloff Mode** | Controls the falloff function applied to the blending of **Blend Distance**. By default the falloff is linear but you can change it to exponential for a more realistic look. |
| **Invert Blend** | Reverses the direction of the fade. Setting the Blend Distances on each axis to its maximum possible value preserves the fog at the center of the Volume and fades the edges. Inverting the blend fades the center and preserves the edges instead. |
| **Distance Fade Start** | Distance from the camera at which the Local Volumetric Fog starts to fade out. This is useful when optimizing a scene with a lot of Local Volumetric Fog and making the more distant ones disappear|
| **Distance Fade End** | Distance from the camera at which the Local Volumetric Fog has completely faded out. This is useful when optimizing a scene with a lot of Local Volumetric Fog and making the more distant ones disappear|
| **Distance Fade Start** | Distance from the camera at which the Local Volumetric Fog starts to fade out. This is useful when optimizing a scene with a lot of Local Volumetric Fog and making the more distant ones disappear |
| **Distance Fade End** | Distance from the camera at which the Local Volumetric Fog has completely faded out. This is useful when optimizing a scene with a lot of Local Volumetric Fog and making the more distant ones disappear |
| **Density Mask Texture** | Specifies a 3D texture mapped to the interior of the Volume. Local Volumetric Fog only uses the RGB channels of the texture for the fog color and A for the fog density multiplier. A value of 0 in the Texture alpha channel results in a Volume of 0 density, and the value of 1 results in the original constant (homogeneous) volume. |
| **Scroll Speed** | Specifies the speed (per-axis) at which the Local Volumetric Fog scrolls the texture. If you set every axis to 0, the Local Volumetric Fog does not scroll the texture and the fog is static. |
| **Tiling** | Specifies the per-axis tiling rate of the texture. For example, setting the x-axis component to 2 means that the texture repeats 2 times on the x-axis within the interior of the volume. |

## Related Settings in the HDRP Asset

There are two settings related to Local Volumetric Fog in the HDRP Asset settings: **Max Local Volumetric Fog Size** and **Max Local Volumetric Fog On Screen**. You can find both of these settings in the HDRP Asset's **Lighting** section.
The [HDRP Asset](HDRP-Asset.md) contains the following settings that relate to Local Volumetric Fog:

![](Images/HDRPAsset_VolumetricSettings.png)
| Property | Description |
|---|---|
| **Max Local Volumetric Fog Size** | Controls the maximum resolution you can use for the **Density Mask Texture**.<br/>This setting can have a high impact on performance. The information box (highlighted in the image below) describes how much memory HDRP allocates for the Local Volumetric Fog system. |
| **Max Local Volumetric Fog On Screen** | Controls how many Local Volumetric Fog components can appear on-screen at once. This setting has an impact on performance, especially at high values. |

The **Max Local Volumetric Fog Size** controls the maximum resolution you can use for the **Density Mask Texture**. Changing this setting can have a large impact on memory usage. For information on how much memory HDRP allocates for the Local Volumetric Fog system, see the info box below this setting in the HDRP Asset.
To change these settings, open the HDRP Asset's **Lighting** section and expand the **Volumetrics** drop down.

The **Max Local Volumetric Fog On Screen** controls how many Local Volumetric Fog components can appear on-screen at once. This setting also has an impact on memory.
![](Images/HDRPAsset_VolumetricSettings.png)

## Builtin Density Mask Texture
## Built in Density Mask Texture

HDRP includes 3D Density Mask Textures with different noise values and shapes that you can use in your scene. To use these Textures, import them from the HDRP samples package:
HDRP includes 3D Density Mask Textures with different noise values and shapes that you can use in your scene. To use these Textures, import them from the High Definition RP package samples:

1. Open the Package Manager window (menu: **Window** > **Package Manager**).
2. Find the High Definition RP package.
3. Expand **Samples**.
4. Find the **Local Volumetric Fog Mask Textures** sample and click on the Import button to the right.
2. Find the **High Definition RP** package.
3. Expand the **Samples** drop-down.
4. Find the **Local Volumetric Fog 3D Texture Samples** and click on the **Import** button to the right.

## Creating a Density Mask Texture

1. In image-editing software of your choice, prepare an RGBA flipbook texture and [import it as a 3D texture](https://docs.unity3d.com/2020.2/Documentation/Manual/class-Texture3D.html). For example, a texture of size 1024x32 describes a 3D texture of size 32x32x32 with 32 slices laid out one after another.
1. In the image-editing software of your choice, create an RGBA flipbook texture and [import it as a 3D texture](https://docs.unity3d.com/2020.2/Documentation/Manual/class-Texture3D.html). For example, a texture of size 1024x32 describes a 3D Texture of size 32x32x32 with 32 slices laid out one after another.

2. Open a Local Volumetric Fog component and assign the texture you just imported to the __Texture__ field in the __Density Mask Texture__ section.
2. Open a **Local Volumetric Fog** component and in its __Density Mask Texture__ section assign the 3D Texture you imported to the __Texture__ field .
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Physically Based Sky

Physically Based Sky simulates a spherical planet with a two-part atmosphere that has an exponentially decreasing density baased on its altitude. This means that the higher you go above sea level, the less dense the atmosphere is. For information on the implementation for this sky type, see [Implementation details](#ImplementationDetails).
Physically Based Sky simulates a spherical planet with a two-part atmosphere that has an exponentially decreasing density based on its altitude. This means that the higher you go above sea level, the less dense the atmosphere is. For information on the implementation for this sky type, see [Implementation details](#ImplementationDetails).

The simulation runs as a pre-process, meaning that it runs once instead of on every frame. The simulation evaluates the atmospheric scattering of all combinations of light and view angles and then stores the results in several 3D Textures, which Unity resamples at runtime. The pre-computation is Scene-agnostic, and only depends on the settings of the Physically Based Sky.

Expand All @@ -9,7 +9,7 @@ The Physically Based Sky’s atmosphere has two types of particles:
* Air particles with [Rayleigh scattering](<https://en.wikipedia.org/wiki/Rayleigh_scattering>).
* Aerosol particles with anisotropic [Mie scattering](https://en.wikipedia.org/wiki/Mie_scattering). You can use aerosols to model pollution, height fog, or mist.

You can use Physically Based Sky to simulate the sky during both daytime and night-time. You can change the time of day at runtime without reducing performance. The following images display a Physically Based Sky in Unity's Fontainebleau demo. For more information about the Fontainebleau demo, and for instructions on how to download and use the demo yourself, see https://github.com/Unity-Technologies/FontainebleauDemo. The available Fontainebleau demo only uses Physically Based Sky for its daytime setup in version 2019.3.
You can use Physically Based Sky to simulate the sky during both daytime and night-time. You can change the time of day at runtime without reducing performance. The following images display a Physically Based Sky in Unity's Fontainebleau demo. For more information about the Fontainebleau demo, and for instructions on how to download and use the demo yourself, see https://github.com/Unity-Technologies/FontainebleauDemo. The Fontainebleau demo only uses Physically Based Sky for its daytime setup in version 2019.3.

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

Expand Down Expand Up @@ -119,7 +119,7 @@ To make this section visible, set **Type** to **Custom Planet**.

This sky type is a practical implementation of the method outlined in the paper [Precomputed Atmospheric Scattering](http://www-ljk.imag.fr/Publications/Basilic/com.lmc.publi.PUBLI_Article@11e7cdda2f7_f64b69/article.pdf) (Bruneton and Neyret, 2008).

This technique assumes that you always view the Scene from above the surface of the planet. This means that if a camera goes below the planet's surface, the sky renders as it would do if the camera was at ground level. Where the surface of the planet is depends on whether you enable or disable **Spherical Mode**:
This technique assumes that you always view the Scene from above the surface of the planet. This means that if a camera goes below the planet's surface, the sky renders as if the camera was at ground level. Where the surface of the planet is depends on whether you enable or disable the **Spherical Mode** property:

* If you enable **Spherical Mode**, the **Planetary Radius** and **Planet Center Position** properties define where the surface is. In this mode, the surface is at the distance set in **Planetary Radius** away from the position set in **Planet Center Position**.
* Otherwise, the **Sea Level** property defines where the surface is. In this mode, the surface stretches out infinitely on the xz plane and **Sea Level** sets its world space height.
Expand All @@ -132,21 +132,22 @@ The default values in either mode make it so the planet's surface is at **0** on

## Warmup performance impact

When you switch to or from a Physically Based Sky, it might cause a noticeable drop in framerate. This is because HDRP performs a large amount of precomputations to render a Physically Based Sky, so the first few frames (depending on the Number of bounces parameter) takes more time to render than other HDRP sky types.
When you switch to or from a Physically Based Sky, it might cause a noticeable drop in framerate. This is because HDRP performs a large amount of precomputations to render a Physically Based Sky, so the first few frames (depending on the **Number of bounces** parameter) takes more time to render than other HDRP sky types.

This also applies when HDRP uses the volume system to interpolate between two different Physically Based Skies with different sets of parameters. To do this, HDRP restarts the precomputation every frame in which it performs interpolation. This causes a noticeable drop in framerate. To avoid this, use a single set of Physically Based Sky parameters for a scene and change the sun light direction and intensity to achieve the result you want.

HDRP restarts precomputation when you change the following parameters:
- Type
- Planetary Radius
- Ground Tint
- Air Maximum Altitude
- Air Density
- Air Tint
- Aerosol Maximum Altitude
- Aerosol Density
- Aerosol Tint
- Aerosol Anisotropy
- Number of Bounces
- **Type**
- **Planetary Radius**
- **Ground Tint**
- **Air Maximum Altitude**
- **Air Density**
- **Air Tint**
- **Aerosol Maximum Altitude**
- **Aerosol Density**
- **Aerosol Tint**
- **Aerosol Anisotropy**
- **Number of Bounces**

### Reference list

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ HDRP uses the [Volume](Volumes.md) framework to calculate SSR, so to enable and

| **Property** | **Description** |
| ----------------------------- | ------------------------------------------------------------ |
| **Screen Edge Fade Distance** | Use the slider to control the distance at which HDRP fades out the refraction effect when the destination of the ray is near the boundaries of the screen. Increase this value to increase the distance from the screen edge at which HDRP fades out the refraction effect for a ray destination. |
| **Screen Weight Distance** | Use the slider to control the distance at which HDRP fades out the refraction effect when the destination of the ray is near the boundaries of the screen. Increase this value to increase the distance from the screen edge at which HDRP fades out the refraction effect for a ray destination. |
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![](Images/volumetric-clouds-1.png)

The **Volumetric Clouds** [Volume component override](Volume-Components.md) controls settings relevant to rendering volumetric clouds in the High Definition Render Pipeline (HDRP). Volumetric clouds are intractable clouds that can render shadows, and receive fog and volumetric light.
The **Volumetric Clouds** [Volume component override](Volume-Components.md) controls settings relevant to rendering volumetric clouds in the High Definition Render Pipeline (HDRP). Volumetric clouds are interactable clouds that can render shadows, and receive fog and volumetric light.

To generate and render volumetric clouds, HDRP uses:

Expand All @@ -19,9 +19,9 @@ Using these three things, HDRP generates volumetric clouds in a two-step process

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

* In your HDRP Asset go to **Lighting > Volumetric Clouds > Volumetric Clouds**.
* In your [HDRP Asset](HDRP Asset) go to **Lighting > Volumetrics > Volumetric Clouds**.

* In your Frame Settings go to **Lighting > Volumetric Clouds**.
* In your [Frame Settings](Frame-Settings.md) go to **Lighting > Volumetric Clouds**.

## Using Volumetric Clouds

Expand Down
Loading