Volumetric Fog & Mist (Built-in) · Core Concepts
Volumetric Fog & Mist 2 integrates with a variety of third-party assets and Unity features. This page covers compatibility notes and setup instructions.
Standard Unity sprite shaders do not write to the Z-buffer, which prevents correct fog interaction. Two custom sprite shaders are included:
| Material | Location | Use Case |
|---|---|---|
| SpriteFogDiffuse | Resources/Extras/ | Diffuse-lit sprites |
| SpriteFogUnlit | Resources/Extras/ | Unlit sprites |
Assign one of these materials to your Sprite Renderers to make sprites fully compatible with the fog image effect.
Assign the Sun game object from Sky Dome to the Sun field in the VolumetricFog Inspector. The fog will synchronize direction and color with the time-of-day cycle.
Add the VolumetricFogDayCycleManager script to any game object in your scene. It modifies fog colors and densities during the day according to the time provided by Enviro.
Two parameters need attention with sky dome assets:
Volumetric Fog & Mist is available from Gaia's Extension Manager with one-click preset buttons for quick configuration.
Compatible with the real terrain only. You may need to reduce Max Distance and combine with Horizon[ON]'s own fog for long-distance coverage.
Embed the fog effect directly into surface shaders for perfect transparency handling.
#pragma surface line. Add noinstancing finalcolor:overlayFog at the end. Use overlayFogStandard for Standard shaders or overlayFogStandardSpecular for specular setup.// Distance fog (optional)
#pragma multi_compile_local __ FOG_DISTANCE_ON
// Point lights (optional)
#pragma multi_compile_local __ FOG_POINT_LIGHTS
// Sun shadows (optional, slow compilation)
#pragma multi_compile_local __ FOG_SUN_SHADOWS_ONfloat4 screenPos and float3 worldPos.#include "Assets/VolumetricFog/Resources/Shaders/VolumetricFogOverlay.cginc"Add the VolumetricFogMaterialIntegration component to the camera with VolumetricFog.
Drag one game object per unique material into the Materials list. Only one object per shader is needed since they share the same material properties.
Similar process for vertex/fragment shaders:
#pragma lines.#include "Assets/VolumetricFog/Resources/Shaders/VolumetricFogOverlayVF.cginc"float3 worldPos and float4 screenPos.col = overlayFog(i.worldPos, i.screenPos, col);VolumetricFogMaterialIntegration to the camera and register objects.Help us improve this documentation page.