Files
FFF_vtt_frozen/client/src
SirStone 2d9548c941 feat(client): fog explored bitmap, vision cut-out and player markers (#70)
The fog layer (DESIGN 7.1 layer 4, spec #63 decision 9) keeps the explored
grid in one cell-resolution RGBA canvas: never-seen cells opaque black,
explored cells black at 0.6 alpha. A second canvas is the sprite texture:
the explored canvas is copied into it and the union of the server's vision
polygons is cut out with `destination-out`. A full explored snapshot
repaints; a cell diff mutates only the new bytes and uploads the dirty
rectangle. Player markers from the marker set/del frames are sprites above
the fog; the GM layer hides the fog.

The cut-out is baked instead of using a Graphics stencil mask: on the e2e's
software renderer the stencil state cost ~350 ms of the phone-class viewport
fill budget (412x869 dpr 2.625), while baking keeps the fill at the pre-fog
baseline. The cut-out is rasterized at cell resolution, the same grid the
server sends.

Integration fix in the tile layer: a tile denied with 403 because it was
unexplored is asked once more when the fog says its cells became explored;
unexplored denials still never retry (the map 403 test is unchanged).

Proven at the reducer seam (fog slice) and by screenshot pixel probes in the
browser e2e: black/dim/visible, window see-through, one-way blind side,
secret door, marker anchor and retraction, a drag that moves the fog with no
reload, and a reconnect resync. Fog update cost recorded under the 412x869
dpr 2.625 / 4x CPU emulation.
2026-11-21 10:44:32 +01:00
..