Let the fog of war tiles overlap into one blanket - #41
Conversation
Unexplored tiles each carried their own fog dome and cloud, scaled exactly to the tile, so the fog of war read as a grid of separate lumps with visible seams (issue tomluchowski#13). Following the recipe proposed there, every fog instance is now drawn half a tile wider than its tile: the opaque dirt domes interlock into one rolling mass, and the cloud quads fade out over their outer third so neighbouring fades blend into each other instead of stacking a hard edge. The cloud fragment shader also read its texture coordinates from a "TexCoords" input that nothing wrote - the vertex shader emits out_UV0 - leaving the noise pattern's anchor undefined. It now reads the coordinates the vertex shader actually provides, which the edge fade needs to know where the quad's borders are. Verified in a running game: the per-tile spike grid in unexplored areas is gone and the fog reads as one connected blanket, with the usual soft creep over the frontier tiles. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014hrk8PiEUMgjYJnTxLF2PU
|
Besides that the fog/ clouds look now much better ! I would merge in this PR, if not the drawback mentioned above. |
Widening every fog dome half a tile in all directions made the domes spill onto neighbouring tiles marked for digging, chewing the yellow marking's edges into jagged teeth (review on PR tomluchowski#41, worst on a one tile wide tunnel, overlapped from both sides). Each dome is now widened per side, only towards a neighbour that is also under fog and not marked for digging, and a marked tile's own dome stays at its exact tile size. Untouched fog still interlocks into one mass, while markings keep the clean tile-aligned edges they had before the widening. Whenever a tile's fog or marking state changes, the widening of its dome and of its neighbours' domes is recomputed. Verified in a running game with a one tile wide marked tunnel through fog: the jagged teeth are gone and the marking reads as one solid band again. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014hrk8PiEUMgjYJnTxLF2PU
|
Good catch — reproduced it exactly (one-tile-wide marked tunnel through fog): the flat 1.5x widening made every fog dome spill a quarter tile onto its neighbours, and where an unmarked dome overlapped a marked tile (and vice versa) the domes' silhouettes interleaved into those jagged yellow/dark teeth. Fixed in 7f40835: the widening is now decided per side, and a dome only extends towards a neighbour that is also under fog and not marked for digging; a marked tile's own dome stays at its exact tile size. So markings keep the clean tile-aligned edges they had before this PR, while untouched fog still interlocks into one blanket. The widening is recomputed for a tile and its neighbours whenever its fog or marking state changes, so marking/unmarking and revealing tiles keep the edges correct. Before (your case reproduced) / after, brightened crops of the same one-tile tunnel: |


Implements Poikilos's recipe from issue #13: each unexplored tile's fog was scaled exactly to the tile, so the fog of war read as a grid of separate lumps. Every fog instance (the opaque dirt dome and the cloud quad) is now drawn 1.5× the tile size, so neighbours overlap by half a tile: the domes interlock into one rolling mass, and the cloud quads fade out over their outer third so overlapping fades blend instead of stacking a hard edge — his "square symmetrical gradient" idea, done in the cloud shader rather than a texture since the cloud is procedural.
Along the way this fixes a latent bug in
Cloud.frag: it read its texture coordinates from aTexCoordsinput that nothing writes (the vertex shader emitsout_UV0), leaving the noise anchor undefined — and the edge fade needs real coordinates to know where the quad's borders are.Before/after of the same unexplored region, brightened for visibility — the per-tile spike grid is gone on the right:
The fog also creeps ~a quarter tile over the frontier tiles now, which reads as natural fog behaviour rather than a defect, and is inherent to the overlap approach (Poikilos's proposal explicitly extends past the block edge). If the effect should be stronger or subtler, the scale factor and the fade width are the two knobs.
🤖 Generated with Claude Code
https://claude.ai/code/session_014hrk8PiEUMgjYJnTxLF2PU