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 used to communicate with shaders. These 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_MapOffset Vector2 The center point of the map bounds in world space
_FogOfWar_MapSize Vector2 The dimensions of the map (width and height)
_FogOfWar_MapSize_Inv Vector2 Inverse of map size (1 / _FogOfWar_MapSize) for optimized calculations
_FogOfWar_MaskTexture Texture2D Mask texture containing visibility data (R: discovered, G: visible)
_FogOfWar_UnexploredFogTexture Texture2D Texture for unexplored fog areas
_FogOfWar_UnexploredFogColor Vector3 Color tint for unexplored fog in linear color space
_FogOfWar_ExploredFogTexture Texture2D Texture for explored but not currently visible areas
_FogOfWar_ExploredFogColor Vector4 Color and alpha for explored fog areas (RGB: color, A: alpha)