Fog of War Docs
View packages

Reference

Performance

Tune visibility and obstacle grids, update rates, backends, presets, and profiler budgets in the recommended order.

Fog of War 26.8.5Unity 6000.0+URP3D XZ worlds

Runtime model

LOS is cached per source in packed bitsets. A source recalculates only when it moves to another visibility cell, activates or deactivates, changes settings, requests every-tick updates, or intersects a changed obstacle region.

Dirty LOS jobs run in parallel with Burst. Composition and CPU presentation also use Burst jobs. Persistent native buffers grow geometrically and are reused. The GPU backend uploads changed packed caches, performs atomic composition and explored accumulation, then temporal smoothing and separable blur. It never performs synchronous readback.

Tuning order

  1. Keep source update mode at OnCellChange.
  2. Reduce visibility resolution before reducing obstacle resolution.
  3. Set an update budget that spreads large spawn bursts across ticks.
  4. Use static bakes for walls and level geometry.
  5. Mark doors and moving blockers dynamic; do not mark static geometry dirty every frame.
  6. Use the Mobile preset for compute-limited or compute-unsupported targets.
  7. Profile a development Editor or player scenario representative of the shipping camera and source count.

Presets

  • Desktop: 512 visibility, 1024 obstacles, 30 Hz, 64 dirty sources per tick.
  • Balanced: 256 visibility, 1024 obstacles, 30 Hz, 32 dirty sources per tick.
  • Mobile: 128 visibility, 512 obstacles, 15 Hz, 16 dirty sources per tick, CPU backend.

The diagnostics window reports source capacity, dirty work, phase timings, estimated native/GPU memory, textures, obstacle cells, and stale bakes.

26.8.5 Reference measurements

After warmup on the current M3 Max validation machine:

  • Balanced 256 visibility / 1024 obstacle terrain fog with 32 moving sources: 0.228 ms total P95, 0.035 ms main or presentation P95, and 0 B managed allocations;
  • 512 visibility / 1024 obstacle stress fog with 128 moving sources: 1.395 ms total P95, 0.271 ms main or presentation P95, 1.581 ms maximum, and 0 B managed allocations;
  • 128 visibility / 512 obstacle CPU fallback with 16 moving sources: 0.204 ms total P95, 0.108 ms main or presentation P95, 0.227 ms maximum, and 0 B managed allocations;
  • competitive authority with 4 observers, 128 moving sources, 512 moving targets, 64 exact 3D obstacles, and 16 concealment volumes: 1.443 ms P95, 1.499 ms maximum, and 0 B managed allocations.

These are validation measurements, not universal frame-time guarantees. Hardware, Burst state, source radii, target density, renderer load, and project code affect the result. Reproduce the supplied stress scenarios on every shipping platform.

Performance depends on source radii, map coverage, platform, rendering load, and Burst compilation state. Measure after warmup and separate Editor-only overhead from package markers: KiwiFogOfWar.Tick, SourceLOS, Compose, and Present.

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.

Email supportJoin Discord

Fog of War 26.8.5

Search documentation