Skip to content

Advanced

This page covers advanced technical details including URP rendering requirements, automatic configuration validation and global shader properties.

URP Depth Texture Requirement

Requires the Depth Texture feature to be enabled in the Universal Render Pipeline (URP) asset for proper functionality.

Automatic Validation

An automatic validator checks and enables the Depth Texture setting when the project loads in the Unity Editor. If disabled, the validator will:

  1. Automatically enable Depth Texture in your active URP asset
  2. Save the changes to the asset
  3. Display a warning message in the Console with a reference to the modified asset

Warning

Disabling the Depth Texture after it has been automatically enabled may cause the fog effect to not render correctly.

Global Shader Properties

Global shader properties are automatically set by the FogOfWarManager and can be accessed in custom shaders.

Property Name Type Description
_FogOfWar_Enabled half Fog enabled state (0 = disabled, 1 = enabled)
_FogOfWar_OrientationXZ float Map orientation (0 = XY plane, 1 = XZ plane)
_FogOfWar_WorldToFogParams float4 World-to-fog UV transformation
- xy: scale values (inverse of map size)
- zw: UV offset values
_FogOfWar_MaskTexture Texture2D Mask texture containing visibility data
- Red channel (x): discovered areas
- Green channel (y): inverse of visible areas
_FogOfWar_UnexploredFogTexture Texture2D Texture for unexplored (hidden) fog areas
_FogOfWar_UnexploredFogColor half3 RGB color tint for unexplored fog (linear color space)
_FogOfWar_ExploredFogTexture Texture2D Texture for explored but not currently visible areas
_FogOfWar_ExploredFogColor half4 RGBA color and alpha for explored fog (linear color space)