fogOfWarKit.package
README.md
fogOfWar
fogOfWarKit's fog-of-war render feature. Every frame it ticks the CPU fog grid (fogOfWarKit.core, which recomputes visibility at the configured rate and uploads the viewer team's grid), then enqueues three passes at afterLighting, ahead of every UI phase so HUDs are never fogged:
fog_smooth(compute, one thread per grid cell, order 125): feathers the grid with a 5x5 tent and eases each cell toward it so revealed ground fades in fast and lost sight fades out slowly.fog_apply(compute, one thread per pixel, order 130): rebuilds each pixel's world position from@scene.depthand@frame.camera, samples the smoothed fog map and redraws the lit colour in the current look:classicblack-and-grey, driftingmistcloud, an oldparchmentmap with burnt edges, orpixeltiles with retro dither.- A fragment copy of the result over the scene colour (order 131).
The result: unexplored ground is hidden, explored ground out of sight is dimmed in the look's style, and everything the viewing team can see is drawn untouched, in the viewport and in offscreen captures alike. Fog.setEnabled(false) or Fog.setRevealAll(true) stand the passes down while the grid keeps updating. Created by fogOfWarKit.api (Fog.setup) or the FogOfWar component; it declares no settings of its own.