Fog Effect Types

intermediate concepts

Dynamic 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 TypePlatformSky HazeDescription
Desktop Fog + Sky HazeDesktopYesDual-noise animated fog with sky haze. Best visual quality for PC/Mac.
Desktop Fog Plus + Sky HazeDesktopYesVolumetric approach that improves coverage when no geometry is in front of the camera.
Mobile Fog + Sky HazeMobileYesSingle-noise variant optimized for mobile. Good balance of quality and speed.
Mobile Fog (No Sky Haze)MobileNoSame as above without the sky haze layer. Saves a texture sample.
Mobile Fog (Simplified)MobileNoVolumetric approach with no noise textures. No animation or turbulence — ideal for static fog.
Mobile Fog (Basic)Low-endNoSimplest variant for low-end mobile devices. Minimal GPU cost.
Orthogonal variantsAnyVariesCompute 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 VariantPerspective ShaderOrthographic Shader
Desktop Fog Plus + Sky HazeDFGDesktopPlusDFODesktopPlus
Desktop Fog Plus OrthogonalDFGDesktopPlusOrthogonalDFODesktopPlusOrthogonal
Desktop Fog + Sky HazeDFGDesktopDFODesktop
Mobile Fog + Sky HazeDFGWithSkyDFOWithSky
Mobile Fog (No Sky Haze)DFGOnlyFogDFOOnlyFog
Mobile Fog (Simplified)DFGSimpleDFOSimple
Mobile Fog OrthogonalDFGOrthogonalDFOOrthogonal
Mobile Fog (Basic)DFGBasicDFOBasic
Tip: You can safely delete unused materials and shaders from the 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.

Important: Do not combine fog materials with the image effect or Post-Processing extensions. Use one approach only.

Setup

  1. Duplicate a material from DynamicFog/Resources/Materials.
  2. Customize its properties (color, texture, metallic/glossiness).
  3. Assign it to your GameObjects — you can mix different material types.
  4. Create an empty GameObject and add the DynamicFogManager script. This centralizes fog control for all fog materials.

Standard Materials (DFM prefix)

MaterialLightingTextureNotes
DFMStandardShaderPBRYesDerived from Unity Standard Shader with fog integrated.
DFMStandardShaderNormalPBRYes + NormalAdds bump mapping.
DFMStandardShaderNormalOcclusionMapPBRYes + Normal + AOAdds separate occlusion map.
DFMStandardShaderNormalOcclusionIntegratedPBRYes + NormalOcclusion stored in main texture alpha.
DFMStandardShaderSolidColorPBRNoSingle color, no textures — faster.
DFMLambertLambertYesSimple diffuse lighting.
DFMLambertSolidColorLambertNoDiffuse + solid color.
DFMUnlitNoneYesNo lighting — texture + fog only.
DFMUnlitSingleColorNoneNoFastest shader — color + fog only.

Reflection Materials (DFR prefix)

These variants add reflection texture support. Assign a reflection texture via mat.SetTexture("_ReflectionTex", texture).

MaterialLightingTexture
DFRStandardShaderPBRYes
DFRStandardShaderSolidColorPBRNo
DFRLambertLambertYes
DFRLambertSolidColorLambertNo
DFRUnlitNoneYes
DFRUnlitSingleColorNoneNo

Next Steps

Was this page helpful?