Fog Effect Types
intermediate conceptsDynamic Fog & Mist 2 (Built-in) · Core Concepts
Overview
Dynamic Fog & Mist 2 includes 7 fog shader variants plus orthogonal counterparts. Each variant trades visual quality for performance, letting you pick the right balance for your target platform.
Effect Types
| Effect Type | Platform | Sky Haze | Description |
|---|---|---|---|
| Desktop Fog + Sky Haze | Desktop | Yes | Dual-noise animated fog with sky haze. Best visual quality for PC/Mac. |
| Desktop Fog Plus + Sky Haze | Desktop | Yes | Volumetric approach that improves coverage when no geometry is in front of the camera. |
| Mobile Fog + Sky Haze | Mobile | Yes | Single-noise variant optimized for mobile. Good balance of quality and speed. |
| Mobile Fog (No Sky Haze) | Mobile | No | Same as above without the sky haze layer. Saves a texture sample. |
| Mobile Fog (Simplified) | Mobile | No | Volumetric approach with no noise textures. No animation or turbulence — ideal for static fog. |
| Mobile Fog (Basic) | Low-end | No | Simplest variant for low-end mobile devices. Minimal GPU cost. |
| Orthogonal variants | Any | Varies | Compute depth and height separately and mix them. Intended for isometric or special-perspective games. |
Shader Mapping
Each effect type uses a specific shader pair depending on the camera projection:
| Fog Variant | Perspective Shader | Orthographic Shader |
|---|---|---|
| Desktop Fog Plus + Sky Haze | DFGDesktopPlus | DFODesktopPlus |
| Desktop Fog Plus Orthogonal | DFGDesktopPlusOrthogonal | DFODesktopPlusOrthogonal |
| Desktop Fog + Sky Haze | DFGDesktop | DFODesktop |
| Mobile Fog + Sky Haze | DFGWithSky | DFOWithSky |
| Mobile Fog (No Sky Haze) | DFGOnlyFog | DFOOnlyFog |
| Mobile Fog (Simplified) | DFGSimple | DFOSimple |
| Mobile Fog Orthogonal | DFGOrthogonal | DFOOrthogonal |
| Mobile Fog (Basic) | DFGBasic | DFOBasic |
DynamicFog/Resources folder to reduce build size.
Custom Fog Materials
As an alternative to the full-screen image effect, Dynamic Fog provides per-object fog materials that integrate the fog calculation directly into the object shader. This avoids the full-screen blit pass and can be faster on older mobile devices.
Setup
- Duplicate a material from
DynamicFog/Resources/Materials. - Customize its properties (color, texture, metallic/glossiness).
- Assign it to your GameObjects — you can mix different material types.
- Create an empty GameObject and add the
DynamicFogManagerscript. This centralizes fog control for all fog materials.
Standard Materials (DFM prefix)
| Material | Lighting | Texture | Notes |
|---|---|---|---|
DFMStandardShader | PBR | Yes | Derived from Unity Standard Shader with fog integrated. |
DFMStandardShaderNormal | PBR | Yes + Normal | Adds bump mapping. |
DFMStandardShaderNormalOcclusionMap | PBR | Yes + Normal + AO | Adds separate occlusion map. |
DFMStandardShaderNormalOcclusionIntegrated | PBR | Yes + Normal | Occlusion stored in main texture alpha. |
DFMStandardShaderSolidColor | PBR | No | Single color, no textures — faster. |
DFMLambert | Lambert | Yes | Simple diffuse lighting. |
DFMLambertSolidColor | Lambert | No | Diffuse + solid color. |
DFMUnlit | None | Yes | No lighting — texture + fog only. |
DFMUnlitSingleColor | None | No | Fastest shader — color + fog only. |
Reflection Materials (DFR prefix)
These variants add reflection texture support. Assign a reflection texture via mat.SetTexture("_ReflectionTex", texture).
| Material | Lighting | Texture |
|---|---|---|
DFRStandardShader | PBR | Yes |
DFRStandardShaderSolidColor | PBR | No |
DFRLambert | Lambert | Yes |
DFRLambertSolidColor | Lambert | No |
DFRUnlit | None | Yes |
DFRUnlitSingleColor | None | No |
Next Steps
- Special Features — fog volumes, fog of war, VR support, gradient fog.
- Performance Tips — choose the right variant for your target platform.
Suggest an improvement
Help us improve this documentation page.