Table of Contents

Fog Sample Modes


The Fog Sample Mode (set on Fog Of War World) controls how the full-screen fog shader samples fog data. It's one of the most important choices for your project, because it determines which features are available and how the fog behaves at scale.

There are three modes.

Pixel-Perfect

Fog is calculated per-pixel in screen space — the original sampling style.

  • Pros: Unlimited world size at full resolution. The fog is always razor-sharp with no grid artifacts, no matter how large your world is.
  • Cons: Only the current frame's information is available, so temporal effects like fog memory / regrow / retention are not possible.

This is the right default for most games, especially large worlds.

Texture Storage

Fog is first calculated into a render texture, which the full-screen shader then samples. This is the more traditional Fog of War approach.

  • Pros: Because fog state persists in a texture, you can use temporal effects such as Fog Regrow and fog memory.
  • Cons: Uses GPU memory for the render texture, and is resolution-bound — large worlds need a high texture resolution to avoid visible grid cells, which costs memory and GPU time.

When you select this mode you must define World Bounds for your world so the texture can be mapped to it. The Fog Regrow option also becomes available.

Both

Samples both Pixel-Perfect and Texture Storage logic at the same time. There is little reason to use this currently — prefer one of the two dedicated modes.

Choosing a Mode

You want… Use
The largest possible world at full sharpness Pixel-Perfect
Fog memory / regrow / retention effects Texture Storage
A minimap texture Either (minimap requires a fog texture, so World Bounds must be set)
Note

The minimap, world-bounds black-out, and Texture Storage sampling all require World Bounds to be defined. See World Bounds.