You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Packages/com.unity.render-pipelines.high-definition/Documentation~/troubleshoot-fog.md
+37-4Lines changed: 37 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,18 +6,19 @@ This document explains how to fix some common visual artifacts that can appear w
6
6
7
7
A slice artifact is the appearance of thin layers around the edge of the volumetric fog. To fix this issue, go to the Local Volumetric Fog component and adjust the following settings:
8
8
9
-
-**Blend Distance**: Set this value above 0.
9
+
-**Blend Distance**: Set this value above 0 to improve visual transitions at the volume’s border and reduce slice artifacts.
10
10
-**Slice Distribution Uniformity**: Increase this value to make the edge of the fog more detailed as it gets closer to the camera.
11
-
-**Volumetric Fog Distance**: Set this property between 20 and 100 to reduce the appearance of artifacts.
12
11
13
12
## Sharp edges
14
13
15
14
To remove the appearance of sharp areas or corners in a volumetric fog, open the [Global Fog](create-a-global-fog-effect.md) component and set the **Denoising Mode** property to one of the following modes:
16
15
-**None**.
17
-
-**Reprojection**: This mode can cause edges to have a blurry artifact (ghosting).
18
-
-**Gaussian**: Use this setting for blurry fog with no hard shapes.
16
+
-**Reprojection**: Disables denoising for fog with sharp edges or hard corners. This option maintains detail, but can introduce ghosting artifacts, and doubles the amount of memory volumetric fog uses.
17
+
-**Gaussian**: Creates soft, blurry fog with undefined shapes. This mode smooths out noise but can blur out sharp features.
19
18
-**Both**: Applies both Reprojection and Gaussian techniques. This setting significantly increases the volumetric fog's memory usage and GPU time.
20
19
20
+
For more physically accurate blending between the fog and the environment, set **Falloff Mode** to **Exponential**.
21
+
21
22
## Light flickering
22
23
23
24
To stop light from flickering in a fog volume, change the following properties:
@@ -27,3 +28,35 @@ To stop light from flickering in a fog volume, change the following properties:
27
28
-**Volumetric Fog Distance**: Set this value between the **Distance Fade Start** and **Distance Fade End** values set in the Local Volumetric Fog component. This makes the fog fade out at the same point as its maximum distance, which reduces light flickering in the distant areas of the fog volume.
28
29
-**Radius**: Increase this value in the [Light](Light-Component.md) component. This lowers the intensity of the light source which makes flickering artifacts less visible.
29
30
31
+
## Optimize fog performance
32
+
33
+
How to optimize volumetric fog depends on the content of your scene and the quality you want. For more information about fog properties, refer to [Fog Volume Override reference](fog-volume-override-reference.md) and [Local Volumetric Fog Volume reference](local-volumetric-fog-volume-reference.md).
34
+
35
+
To make sure all parameters are visible in the **Inspector** window, follow these steps in each Local Volumetric Fog Volume:
36
+
37
+
1. Set **Quality** to **Custom**.
38
+
2. Set **Fog Control Mode** to **Manual**.
39
+
3. At the top of the **Fog** component, open the **More** (⋮) menu and enable **Advanced Properties**.
40
+
41
+
Try adjusting the following properties:
42
+
43
+
- Decrease the **Distance** parameter to reduce the number of fog slices HDRP renders. For long-distance fog, adjust the **Slice Distribution Uniformity** and **Slice Count** instead.
44
+
- Decrease **Volume Slice Count** to reduce the number of fog slices along the camera's forward axis, to reduce GPU and memory usage. Or increase **Volume Slice Count** and reduce **Slice Distribution Uniformity** to focus more slices further from the camera.
45
+
- Set the near and far clipping planes of the camera, to avoid fog rendering too close to the camera. This is particularly important in scenarios such as top-down views, where there may be a significant distance between the camera and the first visible fog or objects.
46
+
- Set **Denoising Mode** to **Gaussian** instead of **Reprojection**, so the fog uses less memory.
47
+
- Reduce the **Screen Resolution Percentage** value to a low value, to limit how much memory and computation fog uses, especially if you have highly diffuse fog.
48
+
- Enable **Directional Lights Only**, especially if you have a large or outdoor scene where only sunlight should contribute to volumetric effects.
49
+
50
+
### Skip lighting calculations in areas with low-density fog
51
+
52
+
To skip lighting calculations for areas where the fog density is below a certain threshold, use the **Volumetric Lighting Density Cutoff** property.
53
+
54
+
This property can improve performance if you use [Local Volumetric Fog Volumes](local-volumetric-fog-volume-reference.md). It doesn't affect scenes with constant or height-based fog because all areas have the same density.
55
+
56
+
Follow these steps:
57
+
58
+
1. To remove global fog from the scene, set a very high **Fog Attenuation Distance**.
59
+
2. Add Local Volumetric Fog Volumes where you want fog to appear.
60
+
3. Increase the **Volumetric Lighting Density Cutoff** gradually, until important fog features begin to disappear.
61
+
62
+
**Note**: This property doesn't take into account changes applied by the **Anisotropy** property. The visibility of fog might not correspond directly to the **Volumetric Lighting Density Cutoff** value in scenes with a lot of anisotropic scattering.
EditorGUILayout.HelpBox($"The current minimum density for the fog is {currentMinExtinction:F3} (calculated from the Fog Distance).",MessageType.Info,wide:true);
/// <summary>Indicates at which fog density the lighting should be ignored. Every voxel containing less fog density than this value will be ignored by the volumetric lighting.</summary>
161
+
[Tooltip("Improves performance by skipping the lighting evaluation in areas with low-density fog. When the value is above 0, HDRP skips calculating volumetric lighting in areas where the fog density is below this value.")]
Copy file name to clipboardExpand all lines: Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricLighting.cs
Copy file name to clipboardExpand all lines: Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricLighting.cs.hlsl
0 commit comments