Troubleshooting
intermediate troubleshootingVolumetric Fog & Mist 2 (URP) · Troubleshooting & FAQ
Solutions to the most common issues when using Volumetric Fog & Mist 2 with the Universal Render Pipeline.
Common Issues
| Symptom | Cause | Solution |
|---|---|---|
| No fog visible | Depth Texture not enabled in URP Asset | Enable Depth Texture in the URP Asset. Check both Project Settings > Graphics and Project Settings > Quality — each quality level may use a different URP Asset. |
| Fog visible in Editor but not in build | Build platform uses a different URP Asset without Depth Texture, or shader variants are stripped | Enable Depth Texture in the URP Asset assigned to the target platform. See Shader Stripping below. |
| Shadows not visible on fog | Shadow Distance too short or Transparent Receive Shadows disabled | In the URP Asset, increase Shadow Distance and enable Transparent Receive Shadows in the Renderer Data. |
| Visible noise / banding | High jittering/dithering or low sample count | Reduce Jittering and Dithering values, or enable Blur in the Volumetric Fog Manager. |
| Fog renders on top of UI canvas | Canvas using non-Overlay render mode | Increase the Order In Layer value on the Canvas component (e.g., set to 1). |
| Fog on top of ocean / transparent objects | Transparent objects do not write to depth buffer | Configure the Depth Pre-Pass in Volumetric Fog Manager. Set transparent layers in the Transparent Objects section. See Transparency Support. |
| Terrain Fit ignores water | Water shader does not write to depth buffer | Use Terrain Fit Min Altitude to match water level, or add an invisible opaque plane on a separate layer included in Terrain Fit Layer Mask. |
| Inverted / flipped depth | URP bug when HDR is OFF, MSAA is x1, and Render Scale is 1 | Enable HDR, MSAA, or change Render Scale. Alternatively, enable Flip Depth Texture in Volumetric Fog Manager. |
| Fog incorrect in VR | Inverted matrices bug in some URP versions | Enable Alternate WS Reconstruction in Volumetric Fog Manager > Shader Options. |
| Shadows missing in WebGL | WebGL shader loop limitations | Enable Force WebGL Compatibility in Volumetric Fog Manager. |
| Shader errors in build (works in Editor) | Strict Shader Variant Matching enabled | Disable Strict Shader Variant Matching in Player Settings > Configuration. |
| Shadows broken with Umbra Soft Shadows | Render Pass Event conflict | Change the Volumetric Fog 2 render feature event from Before Rendering Transparents to Before Rendering Post Processing. |
| Fog incorrect over tessellated ocean | Depth pre-pass uses optimized depth-only shader that skips tessellation | Disable Use Optimized Depth-Only Shader in the Depth PrePass Render Feature. |
Shader Variant Stripping
Some fog features use shader_feature pragmas, which means Unity only includes their shader code if the feature is active in a scene at build time. If you enable features at runtime (e.g., fog of war via script), the variants may be stripped.
Affected Features
| Pragma | Feature |
|---|---|
VF2_DISTANCE | Starting Distance |
VF2_VOIDS | Fog Voids |
VF2_FOW | Fog of War |
VF2_SURFACE | Terrain Fit |
VF2_DEPTH_GRADIENT | Depth Gradient |
VF2_HEIGHT_GRADIENT | Height Gradient |
VF2_LIGHT_COOKIE | Light Cookie |
Solutions
- Replace
shader_featurewith a constant define — e.g., change#pragma shader_feature_local_fragment VF2_FOWto#define VF2_FOW 1. - Add a dummy fog volume in the scene with the required feature enabled so Unity detects and preserves the variant.
- Replace with
multi_compile— e.g.,#pragma multi_compile_local_fragment _ VF2_FOW(note the required underscore before the keyword).
Slow Shader Compilation
The first compilation can be slow due to the number of shader features. To speed it up:
- Remove unused
multi_compilepragma lines from the shader file. - Use Shader Control (available on the Asset Store) to disable unused keywords.
Still Stuck?
Post your question on the Kronnect Support — the team typically responds within 24 hours.
Was this page helpful?
Suggest an improvement
Help us improve this documentation page.