Fog of War Rendering Techniques in Strategy Games

In strategy game development, the “fog of war” is a crucial gameplay mechanic that limits a player’s visibility to only the areas occupied by their units. This article explores the primary rendering techniques developers use to calculate, update, and display this dynamic visual effect in real time, covering grid-based calculations, texture-based rendering, raycasting, post-processing shaders, and compute shaders.

1. Dynamic Texture-Based Visibility

The most common approach for rendering fog of war is using a dynamic, low-resolution 2D texture (often called a “fog texture” or “visibility buffer”).

2. Mesh-Based Projection and Raycasting

For games requiring precise line-of-sight calculations—especially those with verticality, walls, or obstacles—developers use raycasting to generate visibility meshes.

3. Screen-Space Post-Processing and Depth Reconstruction

Modern 3D strategy games often apply the fog of war as a screen-space post-processing effect rather than applying it directly to individual object materials.

4. GPU Compute Shaders

When a strategy game features thousands of units, calculating line-of-sight on the CPU can cause severe performance bottlenecks.