Field Command: RTS Selection, Formations, Fog of War and AI Opponents Kit
- ..
- .metadata63 B
- README.md1.1 KB
- bindings.yaml353 B
- shader.wgsl14.0 KB
README.md
fog_apply
fogOfWarKit's full-screen fog-of-war pass, run by fogOfWar.renderFeature at afterLighting (so the UI drawn later is never fogged).
Per pixel it rebuilds the world position from @scene.depth and the drawn camera (@frame.camera), samples the smoothed fog grid (fog_map, written by fog_smooth), and redraws the lit colour in one of four looks: classic (black unexplored, grey dimmed memory, feathered rims), mist (layered drifting cloud slabs with parallax over unexplored, thin haze over explored), parchment (aged paper with ink contours and a burnt rim, sepia memory) and pixel (crisp square cells, Bayer-dithered transitions, dark bevelled tiles). Sky pixels follow their view ray to the ground plane; a ray that never comes down keeps the sky. It writes fog_out (screen-sized rgba16f), which the feature copies back over the scene colour.
| name | kind |
|---|---|
scene_color | texture2d |
scene_depth | texture_depth |
fog_map | texture2d |
frame_cam | buffer, read vec4<f32> |
apply_params | buffer, read vec4<f32> |
fog_out | storage2d (rgba16f) |