Field Command: RTS Selection, Formations, Fog of War and AI Opponents Kit
- ..
- .metadata48 B
- README.md863 B
- bindings.yaml290 B
- shader.wgsl3.2 KB
README.md
fog_smooth
fogOfWarKit's per-cell smoothing pass, dispatched once per frame by fogOfWar.renderFeature over the fog grid (one invocation per cell, not per pixel).
It reads the packed CPU grid (fog_raw: a storage buffer of u32 words, four cells' visible or explored bytes per word, uploaded with writeBytes), feathers it with a 5x5 tent filter, and eases a persistent r32f state toward that target so cells fade in quickly and fade out slowly instead of popping. It writes fog_map (W x H rgba8: R feathered visible, G feathered explored, B crisp visible, A crisp explored), which the apply pass draws from and which Fog.texture() hands to minimaps.
| name | kind |
|---|---|
fog_raw | buffer, read u32 |
fog_state | storage2d (r32f, read_write) |
fog_map | storage2d (rgba8) |
smooth_params | buffer, read vec4<f32> |