Skip to content
TECHNICALLYARTIST
FAB

The Map Baker

The fog material needs to know where the ground is, so light never spills off the playable area into the void. The Map Baker produces that information as a black-and-white floor map texture:

  • White is ground that can be lit.
  • Black is permanently dark (off the map, out of bounds).

The fog material samples this texture, so a lit radius shows up only where the floor map is white.

Lay meshes over your walkable ground. Stretched cube meshes are a simple, reliable choice. These surfaces are the only ones allowed to receive light; treat everything else as out of bounds.

A level floored with stretched cube meshes

Drag BP_MapBaker from Plugins/FogOfWar/Content/MapBaker into the scene and position it over the play area, then adjust its settings:

The Map Baker actor's settings in the Details panel

SettingWhat it does
Map SizeThe width and length of the fog-covered area. The map does not need to be square; use the longer of the two dimensions.
Bake Smooth (optional)Smooths the edges of the baked texture for a more gradual fog falloff between lit and unlit areas.
Is Map CenteredWhether the world origin (0,0,0) is at the center of the map or at a corner, so the baker aligns to the layout.

The Map Size and centering you choose here must also be set on the Fog Manager so the fog and the floor map line up.

The Bake Smooth option softens the boundary between lit and dark ground:

Comparison of a hard versus smoothed floor-map edge

Select your floor actors and add the FLOOR tag. The baker only captures tagged actors, so props and decoration are ignored. White in the baked texture is where these floors are; everything else stays dark.

Adding the FLOOR tag to a mesh actor

With every floor actor tagged, click Bake on the Map Baker to generate the floor texture.

The Bake button on the Map Baker

Once baked, you have two ways to use the result:

ModeHowWhen to use
StaticSave the baked texture and assign it to the Fog Manager’s Floor Map Texture, then remove the baker actor from the level.Recommended. The floor never changes at runtime, so a saved texture is the cheapest option.
DynamicLeave BP_MapBaker in the level so it provides its render target to the fog at runtime.Only if the playable floor can change shape during play.

Assigning the baked texture to the Fog Manager's Floor Map Texture

If you bake a static texture, the Map Baker actor is no longer needed and can be safely removed from the level:

Removing the Map Baker actor after a static bake