Skip to content

fix: use worldY (depth) in fog shader, remove CPU Y-flip#1244

Merged
braedonsaunders merged 1 commit into
mainfrom
claude/fix-fog-of-war-BqamZ
Feb 2, 2026
Merged

fix: use worldY (depth) in fog shader, remove CPU Y-flip#1244
braedonsaunders merged 1 commit into
mainfrom
claude/fix-fog-of-war-BqamZ

Conversation

@braedonsaunders

Copy link
Copy Markdown
Owner

The fog of war shader was using worldZ (altitude) for the V coordinate, but ground units always have worldZ≈0, so they sampled the same texture row regardless of north-south position. This caused:

  • Wrong base revealed on startup
  • Moving south revealed north (inverted)

Fixes:

  1. EffectPasses.ts: Change visionV from worldZ to worldY (depth)
  2. FogOfWar.ts: Remove Y-flip to match GPU path (VisionCompute)

The GPU path (VisionCompute) writes directly to texture coords (cellX, cellY) without any flip, so the CPU path must match.

https://claude.ai/code/session_013Hqn3PxBW8h7hpMNMKKv1e

The fog of war shader was using worldZ (altitude) for the V coordinate,
but ground units always have worldZ≈0, so they sampled the same texture
row regardless of north-south position. This caused:
- Wrong base revealed on startup
- Moving south revealed north (inverted)

Fixes:
1. EffectPasses.ts: Change visionV from worldZ to worldY (depth)
2. FogOfWar.ts: Remove Y-flip to match GPU path (VisionCompute)

The GPU path (VisionCompute) writes directly to texture coords (cellX, cellY)
without any flip, so the CPU path must match.

https://claude.ai/code/session_013Hqn3PxBW8h7hpMNMKKv1e
@braedonsaunders braedonsaunders merged commit 74f9c61 into main Feb 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants