From b73d22801ecc66d09eb91f81f9f1d85697e06579 Mon Sep 17 00:00:00 2001 From: Lewis Jordan Date: Thu, 3 Dec 2020 12:56:01 +0000 Subject: [PATCH 1/4] Updated fog documentation --- .../Documentation~/Override-Fog.md | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Override-Fog.md b/com.unity.render-pipelines.high-definition/Documentation~/Override-Fog.md index 54830e1e9a1..80e78a762ba 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Override-Fog.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Override-Fog.md @@ -50,13 +50,20 @@ The **Fog** override of the active Volume controls the appearance of the global | **- Mip Fog Far** | The distance (in meters) from the Camera that HDRP starts sampling the highest resolution mipmap for the fog color.
This property only appears when you select **Sky Color** from the **Color Mode** drop-down. | | **- Mip Fog Max Mip** | Use the slider to set the maximum mipmap that HDRP uses for the mip fog. This defines the mipmap that HDRP samples for distances greater than **Mip Fog Far**.
This property only appears when you select **Sky Color** from the **Color Mode** drop-down. | | **- Constant Color** | Use the color picker to select the color of the fog.
This property only appears when you select **Constant Color** from the **Color Mode** drop-down. | -| **Volumetric Fog** | Enables Volumetric Fog. | -| **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. | -| **Anisotropy** | Controls the angular distribution of scattered light. 0 is isotropic, 1 is forward scattering, and -1 is backward scattering. Note that non-zero values have a moderate performance impact. High values may have compatibility issues with the Enable Reprojection for Volumetrics Frame Setting. This is an experimental property that HDRP applies to both global and local fog. | -| **Ambient Light Probe Dimmer** | Reduces the intensity of the global Ambient Light Probe that the sky generates. | -| **Depth Extent** | Determines the distance (in meters) from the Camera at which the volumetric fog section of the frustum ends. | -| **Slice Distribution Uniformity** | Controls the uniformity of the distribution of slices along the Camera's focal axis. HDRP samples volumetric fog at multiple distances from the Camera. Each of these sample areas is called a slice. A value of 0 makes the distribution of slices exponential (the spacing between the slices increases with the distance from the Camera) which gives greater precision near to the Camera, and lower precision further away. A value of 1 results in a uniform distribution which gives the same level of precision regardless of the distance to the Camera. | -| **Filter** | Applies a blur to smoothen the volumetric lighting output. | +| **Volumetric Fog** | Indicates whether HDRP should calculate volumetric fog or not. | +| - **Albedo** | The color of the volumetric fog to. 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 through fog with a red **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. | +| - **Ambient Light Probe Dimmer** | The amount to dim the intensity of the global ambient light probe that the sky generates. A value of 0 does not dim the light probe and a value of 1 fully dims the light probe. | +| - **Volumetric Fog Distance** | The distance (in meters) from the Camera at which the volumetric fog section of the frustum ends. | +| - **Denoising Mode** | The denoising technique to use for the volumetric fog. The options are:
• **None**: Applies no denoising.
• **Reprojection**: A denoising technique that is very effective for static lighting, but can lead to severe ghosting for highly dynamic lighting.
• **Gaussian**: A denoising technique that is better than **Reprojection** for dynamic lighting.
• **Both**: Applies both **Reprojection** and **Gaussian** techniques. Using both techniques can produce high quality results but significantly increases the resource intensity of the effect. | +| - **Slice Distribution Uniformity** | The uniformity of the distribution of slices along the Camera's forward axis. HDRP samples volumetric fog at multiple distances from the Camera. Each of these sample areas is called a slice. A value of 0 makes the distribution of slices exponential (the spacing between the slices increases with the distance from the Camera) which gives greater precision near to the Camera, and lower precision further away. A value of 1 results in a uniform distribution which gives the same level of precision regardless of the distance to the Camera. | +| - **Quality** | Specifies the preset HDRP uses to populate the values of the following nested properties. The options are:
• **Low**: A preset that emphasizes performance over quality.
• **Medium**: A preset that balances performance and quality.
• **High**: A preset that emphasizes quality over performance.
• **Custom**: Allows you to override each property individually.
If you select any value other than **Custom**, **Fog Control Mode** switches to **Balance**. | +| - - **Fog Control Mode** | Specifies the method to use to control the performance and quality of the volumetric fog. The options are:
• **Balance**: Uses a performance-oriented approach to define the quality of the volumetric fog.
• **Manual**: Gives you access to the internal set of properties which directly control the effect. | +| - - - **Volumetric Fog Budget** | The performance to quality ratio of the volumetric fog. A value of 0 being the least resource-intensive and a value of 1 being the highest quality.
This property only appears if you set **Fog Control Mode** to **Balance**. | +| - - - **Resolution Depth Ratio** | The ratio HDRP uses to share resources between the screen (x-axis and y-axis) and the depth (z-axis) resolutions.
This property only appears if you set **Fog Control Mode** to **Balance**. | +| - - - **Screen Resolution Percentage** | The resolution of the volumetric buffer (3D texture) along the x-axis and y-axis relative to the resolution of the screen.
This property only appears if you set **Fog Control Mode** to **Manual**. | +| - - - **Volume Slice Count** | The number of slices to use for the volumetric buffer (3D texture) along the camera's focal axis.
This property only appears if you set **Fog Control Mode** to **Manual**. | +| - **Directional Lights Only** | Indicates whether HDRP only process volumetric fog for directional [Lights](Light-Component.md) or for all Lights. | +| - **Anisotropy** | Controls the angular distribution of scattered light. 0 is isotropic, 1 is forward scattering, and -1 is backward scattering. Note that non-zero values have a moderate performance impact. High values may have compatibility issues with the **Enable Reprojection for Volumetrics** Frame Setting. This is an experimental property that HDRP applies to both global and local fog. | ## Light-specific Properties From cd40d745668e486e4fceb01095bc8c13a402b72d Mon Sep 17 00:00:00 2001 From: Lewis Jordan Date: Thu, 3 Dec 2020 13:01:58 +0000 Subject: [PATCH 2/4] Updated tooltips --- .../Documentation~/Override-Fog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Override-Fog.md b/com.unity.render-pipelines.high-definition/Documentation~/Override-Fog.md index 80e78a762ba..d51ba80e3fb 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Override-Fog.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Override-Fog.md @@ -62,7 +62,7 @@ The **Fog** override of the active Volume controls the appearance of the global | - - - **Resolution Depth Ratio** | The ratio HDRP uses to share resources between the screen (x-axis and y-axis) and the depth (z-axis) resolutions.
This property only appears if you set **Fog Control Mode** to **Balance**. | | - - - **Screen Resolution Percentage** | The resolution of the volumetric buffer (3D texture) along the x-axis and y-axis relative to the resolution of the screen.
This property only appears if you set **Fog Control Mode** to **Manual**. | | - - - **Volume Slice Count** | The number of slices to use for the volumetric buffer (3D texture) along the camera's focal axis.
This property only appears if you set **Fog Control Mode** to **Manual**. | -| - **Directional Lights Only** | Indicates whether HDRP only process volumetric fog for directional [Lights](Light-Component.md) or for all Lights. | +| - **Directional Lights Only** | Indicates whether HDRP only process volumetric fog for directional [Lights](Light-Component.md) or for all Lights. Including non-directional Lights increases the resource intensity of the effect. | | - **Anisotropy** | Controls the angular distribution of scattered light. 0 is isotropic, 1 is forward scattering, and -1 is backward scattering. Note that non-zero values have a moderate performance impact. High values may have compatibility issues with the **Enable Reprojection for Volumetrics** Frame Setting. This is an experimental property that HDRP applies to both global and local fog. | From 8009c51f93540920350a3354053a225369161145 Mon Sep 17 00:00:00 2001 From: Lewis Jordan Date: Thu, 3 Dec 2020 13:02:19 +0000 Subject: [PATCH 3/4] Update Fog.cs --- .../Lighting/AtmosphericScattering/Fog.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/Fog.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/Fog.cs index e362c201363..69739dedae1 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/Fog.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/Fog.cs @@ -59,7 +59,7 @@ public class Fog : VolumeComponentWithQuality public MinFloatParameter depthExtent = new MinFloatParameter(64.0f, 0.1f); /// Controls which denoising technique to use for the volumetric effect. /// Reprojection mode is effective for static lighting but can lead to severe ghosting artifacts with highly dynamic lighting. Gaussian mode is effective with dynamic lighting. You can also use both modes together which produces high-quality results, but increases the resource intensity of processing the effect. - [Tooltip("Controls which denoising technique to use for the volumetric effect. Reprojection is very effective for static lighting, but can lead to severe ghosting for highly dynamic lighting. Gaussian is a good alternative for dynamic lighting. Using both techniques can give high quality results but significantly increases the resource intensity of the effect.")] + [Tooltip("Specifies the denoising technique to use for the volumetric effect.")] public FogDenoisingModeParameter denoisingMode = new FogDenoisingModeParameter(FogDenoisingMode.Gaussian); // Advanced parameters @@ -89,14 +89,14 @@ public FogControl fogControlMode set { m_FogControlMode.value = value; } } [SerializeField, FormerlySerializedAs("fogControlMode")] - [Tooltip("Controls which method to use to control the performance and quality of the volumetric fog. Balance mode allows you to use a performance-oriented approach to define the quality of the volumetric fog. Manual mode gives you access to the internal set of properties which directly control the effect.")] + [Tooltip("Specifies which method to use to control the performance and quality of the volumetric fog. ")] private FogControlParameter m_FogControlMode = new FogControlParameter(FogControl.Balance); - /// Stores the resolution of the volumetric buffer (3D texture) along the x-axis and y-axis relative to the resolution of the frame buffer. - [Tooltip("Stores the resolution of the volumetric buffer (3D texture) along the x-axis and y-axis relative to the resolution of the frame buffer.")] + /// Stores the resolution of the volumetric buffer (3D texture) along the x-axis and y-axis relative to the resolution of the screen. + [Tooltip("Controls the resolution of the volumetric buffer (3D texture) along the x-axis and y-axis relative to the resolution of the screen.")] public ClampedFloatParameter screenResolutionPercentage = new ClampedFloatParameter(optimalFogScreenResolutionPercentage, minFogScreenResolutionPercentage, maxFogScreenResolutionPercentage); /// Number of slices of the volumetric buffer (3D texture) along the camera's focal axis. - [Tooltip("Number of slices of the volumetric buffer (3D texture) along the camera's focal axis.")] + [Tooltip("Controls the number of slices to use the volumetric buffer (3D texture) along the camera's focal axis.")] public ClampedIntParameter volumeSliceCount = new ClampedIntParameter(64, 1, maxFogSliceCount); /// Defines the performance to quality ratio of the volumetric fog. A value of 0 being the least resource-intensive and a value of 1 being the highest quality. @@ -113,7 +113,7 @@ public float volumetricFogBudget set { m_VolumetricFogBudget.value = value; } } [SerializeField, FormerlySerializedAs("volumetricFogBudget")] - [Tooltip("Defines the performance to quality ratio of the volumetric fog. A value of 0 being the least resource-intensive and a value of 1 being the highest quality.")] + [Tooltip("Controls the performance to quality ratio of the volumetric fog. A value of 0 being the least resource-intensive and a value of 1 being the highest quality.")] private ClampedFloatParameter m_VolumetricFogBudget = new ClampedFloatParameter(0.25f, 0.0f, 1.0f); /// Controls how Unity shares resources between Screen (XY) and Depth (Z) resolutions. @@ -130,11 +130,11 @@ public float resolutionDepthRatio set { m_ResolutionDepthRatio.value = value; } } [SerializeField, FormerlySerializedAs("resolutionDepthRatio")] - [Tooltip("Controls how Unity shares resources between Screen (XY) and Depth (Z) resolutions.")] + [Tooltip("Controls how Unity shares resources between Screen (x-axis and y-axis) and Depth (z-axis) resolutions.")] public ClampedFloatParameter m_ResolutionDepthRatio = new ClampedFloatParameter(0.5f, 0.0f, 1.0f); /// Indicates whether Unity includes or excludes non-directional light types when it evaluates the volumetric fog. Including non-directional lights increases the resource intensity of the effect. - [Tooltip("Indicates whether Unity includes or excludes non-directional light types when it evaluates the volumetric fog. Including non-directional lights increases the resource intensity of the effect.")] + [Tooltip("When enabled, HDRP only includes directional Lights when it evaluates volumetric fog.")] public BoolParameter directionalLightsOnly = new BoolParameter(false); internal static bool IsFogEnabled(HDCamera hdCamera) From d82db32217ce41004c0e53cf27cb93c84decb0a7 Mon Sep 17 00:00:00 2001 From: Lewis Jordan Date: Thu, 3 Dec 2020 13:02:49 +0000 Subject: [PATCH 4/4] Update Fog.cs --- .../Runtime/Lighting/AtmosphericScattering/Fog.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/Fog.cs b/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/Fog.cs index 69739dedae1..411ddbdbe23 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/Fog.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Lighting/AtmosphericScattering/Fog.cs @@ -89,7 +89,7 @@ public FogControl fogControlMode set { m_FogControlMode.value = value; } } [SerializeField, FormerlySerializedAs("fogControlMode")] - [Tooltip("Specifies which method to use to control the performance and quality of the volumetric fog. ")] + [Tooltip("Specifies which method to use to control the performance and quality of the volumetric fog.")] private FogControlParameter m_FogControlMode = new FogControlParameter(FogControl.Balance); /// Stores the resolution of the volumetric buffer (3D texture) along the x-axis and y-axis relative to the resolution of the screen.