feat(client): deferred ground shading — fix relief overdraw (#240) #243

Merged
panda merged 6 commits from feat/ground-visibility-buffer into main 2026-08-01 18:30:39 +02:00
Collaborator

Summary

Elimina l'overdraw del ground shader sull'heightfield iso (implementa spec/piano #240; i fix depth sono un dead-end su DesktopGL/SM3). Il ground si disegna in due passate:

  • Pass 1 (visibility): la mesh Z-displaced (far→near, opaque, no depth) scrive in una RT Vector4 viewport-sized solo (worldX, worldY, hillshade, coverage) per pixel visibile — painter's order tiene il visibile, niente overdraw di lavoro costoso.
  • Pass 2 (composite): un fullscreen quad ricalcola il colore SDF una volta per pixel dai worldXY.

Ricalcola (non ri-filtra) → pixel-identico. Niente depth. GroundColour(cell) condiviso MainPS/CompositePS. Fallback single-pass se Vector4 non supportato.

Screenshots / recording

ground identical, overdraw gone

Terreno (piatto + rilievo) visivamente identico a prima; nessun buco/nero/crepa.

How it was tested

  • Perf (strumentazione temp, rimossa): foothill da ~11.8ms → ~2.3–3ms (come il piatto), 60fps in primo piano, drops=0. (maxDt ~46ms solo con finestra in background = InactiveSleepTime MonoGame, artefatto — non regressione.)
  • Visivo pixel-identico su spawn/costa/foothill/vulcano.
  • Gate: build intera 0 warning, test verdi, CSharpier pulito.
  • Design: spec + piano in docs/superpowers/.

Checklist

  • just lint passes (CSharpier + analyzers, zero warnings)
  • just test is green
  • The whole solution builds (client and tools included)
  • Multi-platform preserved (server on Win/macOS/Linux, client on Win/macOS)
  • Tests added/updated — N/A (resa GPU; verifica visiva/perf via harness)
  • Linked the related issue and its Definition of Done is met

Chiude #240. Stacked su #239 (PR #242): finché #242 non merge, questa PR mostra anche il commit hillshade — dopo il merge rebaso su main e resta solo il delta overdraw. Deferred: ottimizzazione D (skip pesi-zero) → follow-up misurato.

## Summary Elimina l'**overdraw** del ground shader sull'heightfield iso (implementa spec/piano #240; i fix depth sono un dead-end su DesktopGL/SM3). Il ground si disegna in **due passate**: - **Pass 1 (visibility)**: la mesh Z-displaced (far→near, opaque, no depth) scrive in una RT `Vector4` viewport-sized solo `(worldX, worldY, hillshade, coverage)` per pixel visibile — painter's order tiene il visibile, **niente overdraw di lavoro costoso**. - **Pass 2 (composite)**: un fullscreen quad **ricalcola** il colore SDF una volta per pixel dai `worldXY`. Ricalcola (non ri-filtra) → **pixel-identico**. Niente depth. `GroundColour(cell)` condiviso `MainPS`/`CompositePS`. Fallback single-pass se `Vector4` non supportato. ## Screenshots / recording ![ground identical, overdraw gone](https://git.homelab.devncode.it/attachments/7ce5a811-5468-40de-a2b0-cd4563da8854) Terreno (piatto + rilievo) **visivamente identico** a prima; nessun buco/nero/crepa. ## How it was tested - **Perf** (strumentazione temp, rimossa): foothill da **~11.8ms → ~2.3–3ms** (come il piatto), **60fps** in primo piano, `drops=0`. (`maxDt` ~46ms solo con finestra in background = `InactiveSleepTime` MonoGame, artefatto — non regressione.) - **Visivo** pixel-identico su spawn/costa/foothill/vulcano. - **Gate**: build intera **0 warning**, test verdi, CSharpier pulito. - Design: spec + piano in `docs/superpowers/`. ## Checklist - [x] `just lint` passes (CSharpier + analyzers, zero warnings) - [x] `just test` is green - [x] The whole solution builds (client and tools included) - [x] Multi-platform preserved (server on Win/macOS/Linux, client on Win/macOS) - [x] Tests added/updated — N/A (resa GPU; verifica visiva/perf via harness) - [x] Linked the related issue and its Definition of Done is met Chiude **#240**. **Stacked su #239 (PR #242)**: finché #242 non merge, questa PR mostra anche il commit hillshade — dopo il merge rebaso su main e resta solo il delta overdraw. **Deferred:** ottimizzazione D (skip pesi-zero) → follow-up misurato.
panda force-pushed feat/ground-visibility-buffer from 164735235c
All checks were successful
ci / Lua content lint (pull_request) Successful in 24s
ci / Lint & Test (pull_request) Successful in 5m48s
to 5b3787a4ad
All checks were successful
ci / Lua content lint (pull_request) Successful in 10s
ci / Lint & Test (pull_request) Successful in 4m43s
2026-08-01 18:24:07 +02:00
Compare
panda merged commit 7c86083fc9 into main 2026-08-01 18:30:39 +02:00
panda deleted branch feat/ground-visibility-buffer 2026-08-01 18:30:39 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
marco/IsoMmo!243
No description provided.