Volumetric Fog & Mist (Built-in) · Troubleshooting & FAQ
This page covers techniques to reduce build time, binary size, and runtime overhead when shipping Volumetric Fog & Mist 2 in production builds.
The single most impactful optimization for build time. Open Shader Options at the top of the VolumetricFog Inspector and disable every feature you do not use. Each disabled keyword can significantly reduce shader compilation time.
| Pragma Line | Feature | Disable If... |
|---|---|---|
FOG_DISTANCE_ON | Starting Distance | Starting Distance is always 0 |
FOG_VOID_SPHERE / FOG_VOID_BOX | Fog Void | Not using fog void areas |
FOG_AREA_SPHERE / FOG_AREA_BOX | Fog Areas | Not using fog area containers |
FOG_HAZE_ON | Sky Haze | Sky Haze is always 0 |
FOG_OF_WAR_ON | Fog of War | Not using fog of war |
FOG_POINT_LIGHTS | Point Lights | Not using fog point lights |
FOG_SCATTERING_ON | Light Scattering | Not using god rays |
FOG_SURFACE | Terrain Fit | Not using terrain fit |
For maximum control, edit VolumetricFog.shader directly:
#pragma multi_compile line and any related #if/#endif blocks.#pragma line AND remove the #if/#endif guards, leaving the code always active. This eliminates the keyword variant without losing the feature.Delete or exclude the Demo folder when importing into production projects. Demo scenes, scripts and assets are not required by the asset.
If you encounter shader errors in builds that do not occur in the Editor, disable Strict Shader Variant Matching in Player Settings > Configuration.
For project-wide shader keyword management across all assets, consider using Shader Control to audit and strip unused variants.
Help us improve this documentation page.