Getting started
Setup
Configure bounds, resolution, visibility presets, sources, targets, obstacles, and the depth-aware URP renderer.
Requirements
Fog of War 26.8.5 supports Unity 6.0 or newer with URP. The promised renderer mode is a 3D world projected onto XZ.
Quick Setup
Choose Tools > Kiwi Studios > Fog of War > Quick Setup. The command creates:
- a
FogWorldroot; - a balanced
FogWorldProfile; - recommended vision, target, and modifier ScriptableObjects;
- a default
FogVisionSourceusing the Standard Sight archetype; - explicit
FogCameraRendererbindings for cameras in the active scene.
Depth-aware rendering needs one FogRendererFeature in every configured URP Universal Renderer asset. When a renderer needs to change, Quick Setup first displays a project-level warning containing the exact asset paths and OK and Cancel buttons. OK installs or repairs the feature and then completes scene setup. Cancel stops setup and leaves the renderer assets and scene untouched. A second run is idempotent and does not prompt when the renderers are already correct.
Quick Setup selects and repairs an existing world instead of creating a duplicate. It disables legacy FogSurfaceRenderer components and their mesh renderers through Unity Undo so upgraded scenes cannot draw fog twice. With exactly one active world, rendering also resolves automatically for cameras created later. Add or configure FogCameraRenderer explicitly when multiple worlds can be active for one camera.
Bounds and resolution
FogWorldProfile stores XZ bounds as a center and size. The default profile uses a 256 × 256 visibility grid and 1024 × 1024 obstacle grid over 200 × 200 world units at 30 Hz.
Visibility presets
Every profile has an independent visibility preset:
Explorationpreserves Unexplored, Explored, and Visible states. This is the traditional RTS presentation and enables exploration capture and restore.Mobapresents every cell outside current observer vision identically. It does not accumulate new exploration data, and exploration capture returns no snapshot.
Use the Exploration and MOBA buttons in the profile inspector to apply the recommended colors and fade timings. Performance quality remains independently selectable through Desktop, Balanced, and Mobile.
The visibility grid controls visual and query granularity. The obstacle grid captures collider footprints before conservative downsampling to visibility cells. Resize or move the bounds only before baking and saving exploration data.
Vision sources
The fastest authoring path is to assign a FogVisionArchetype to FogVisionSource. Archetypes combine one or more sensors and reusable rule assets. A sensor selects circle or cone shape, radius, angle, eye height, detection channels, distance mode, visible gameplay layers, obstacle behavior, brush reveal, and whether it contributes to the terrain mask. Sources also select faction, owner, layer, shared-vision behavior, active state, and priority.
Use Tools > Kiwi Studios > Fog of War > Create Recommended Archetypes to create Standard Sight, Detector, True Sight, Unobstructed Sight, and Cone Sight source assets plus visible, camouflaged, stealthed, and obscured targets. It also creates radius boost, nearsight, and temporary reveal presets. The operation only fills missing assets and does not overwrite edited content.
The legacy radius and 32-bit mask source settings remain supported for straightforward terrain fog and upgrades. Radius uses world units. Strength is normalized from 0 to 1. The legacy visibility mask is matched against FogWorld.ObserverMask.
OnCellChange is the recommended update mode. EveryTick is intended for special cases. Manual requires Refresh or FogWorld.UpdateSource after movement.
Observers and targets
Add FogVisionObserver for a local player, server connection, spectator, or independent query context. It controls faction, owner identity, visible gameplay layers, allied sharing, spectator mode, active state, and nearsight.
Add FogVisibilityTarget to any actor that needs entity-level presentation, targetability, last-known state, detection, or network relevance. Assign a FogTargetArchetype, faction, server-owned identity, gameplay layer, and optional transform tracking. A source and target can coexist on the same actor.
Add FogConcealmentVolume for a declared one-way brush, opaque volume, or detection-only region. These volumes participate in entity authority. They do not need or create trigger callbacks and are not found through scene-wide scans.
Use the Debug Window to inspect compiled sources, effective observer settings, target decisions, reason flags, concealment volumes, interest changes, and presentation textures.
Obstacles
Add FogObstacle to a declared collider and assign its world. Static obstacles belong in a bake. Dynamic obstacles register live cell references and invalidate only affected source caches when marked dirty.
Box, Sphere, and Capsule colliders use projected shape footprints. Other collider types use a documented conservative world-bounds footprint. FogObstacleBoundsOverride can replace a footprint, including for unusual meshes or vegetation.
No runtime scene-wide collider search is performed.
Rendering
The primary URP adapter is depth-aware and does not create world-space fog geometry. FogRendererFeature reads the camera depth texture, reconstructs the visible opaque world position for every covered pixel, projects its XZ coordinate into the profile bounds, and blends the fog before post-processing. Terrain, stairs, floors, doors, and walls therefore receive fog at their actual rendered height without an elevated Quad, depth offset, or per-level setup. Sky and pixels outside the world bounds remain unchanged.
The combined texture stores current visibility in red and explored visibility in green; green remains unused in MOBA mode. Presentation colors, fades, blur, and visibility mode come from the profile.
FogSurfaceRenderer remains available as an opt-in compatibility adapter for unusual cameras or custom pipelines. It uses a unit Quad and should be placed at the gameplay plane, but it is not created by Quick Setup and is not used by the included samples.
The GPU backend uses compute shaders when available. Auto falls back to the Burst CPU backend without synchronous GPU readback.
Still stuck?
Bring the world state with you.
Include the Fog of War version, Unity and URP versions, active profile and backend, relevant logs, diagnostics, and the smallest reproducible scene.