Table of Contents

Interface IFogOfWarRenderer

Namespace
Map.Rendering.FogOfWar
Assembly
MapAssembly.dll

ENGINE: Interface for pluggable fog of war rendering implementations.

ENGINE provides default compute-shader based implementation. GAME can register custom implementations for different fog styles:

  • Different visual effects (animated fog, stylized clouds)
  • Alternative visibility rules
  • Performance optimizations for specific use cases

Pattern 20: Pluggable Implementation (Interface + Registry)

public interface IFogOfWarRenderer

Properties

DisplayName

Human-readable name for UI/debugging

string DisplayName { get; }

Property Value

string

IsEnabled

Get current enabled state

bool IsEnabled { get; }

Property Value

bool

RendererId

Unique identifier for this renderer (e.g., "Default", "Stylized", "Minimal")

string RendererId { get; }

Property Value

string

RequiresPerFrameUpdate

Whether this renderer needs per-frame updates (e.g., animated fog)

bool RequiresPerFrameUpdate { get; }

Property Value

bool

Methods

ApplyToMaterial(Material, FogOfWarStyleParams)

Apply style parameters to material (shader uniforms)

void ApplyToMaterial(Material material, FogOfWarStyleParams styleParams)

Parameters

material Material
styleParams FogOfWarStyleParams

Dispose()

Cleanup resources

void Dispose()

GetPlayerCountry()

Get the current player country ID

ushort GetPlayerCountry()

Returns

ushort

GetProvinceVisibility(ushort)

Get visibility level for a province (0.0 = unexplored, 0.5 = explored, 1.0 = visible)

float GetProvinceVisibility(ushort provinceID)

Parameters

provinceID ushort

Returns

float

Initialize(MapTextureManager, FogOfWarRendererContext)

Initialize the renderer with required dependencies

void Initialize(MapTextureManager textureManager, FogOfWarRendererContext context)

Parameters

textureManager MapTextureManager
context FogOfWarRendererContext

OnRenderFrame()

Called each frame if RequiresPerFrameUpdate is true

void OnRenderFrame()

RevealProvince(ushort)

Reveal a specific province (mark as explored)

void RevealProvince(ushort provinceID)

Parameters

provinceID ushort

SetEnabled(bool)

Set whether fog of war is enabled

void SetEnabled(bool enabled)

Parameters

enabled bool

SetPlayerCountry(ushort)

Set the player's country for visibility calculations

void SetPlayerCountry(ushort countryID)

Parameters

countryID ushort

UpdateVisibility()

Update visibility state based on current ownership

void UpdateVisibility()