Skip to content

EN-023 groundwork: SDF card lookup (world AABBs, smallest-box pick) + WSRC ground bounce#79

Closed
proggeramlug wants to merge 1 commit into
fix/round2-stabilityfrom
feat/en023-gi-sw-cards
Closed

EN-023 groundwork: SDF card lookup (world AABBs, smallest-box pick) + WSRC ground bounce#79
proggeramlug wants to merge 1 commit into
fix/round2-stabilityfrom
feat/en023-gi-sw-cards

Conversation

@proggeramlug

Copy link
Copy Markdown
Contributor

Stacked on #75. Implements the correctness half of EN-023 with honest measurements attached.

What was broken (audit F4)

On non-RT adapters the SDF probe trace compared world-space clipmap hits against object-space card AABBs — only identity-transform assets (Sponza) ever matched, so every one of the shooter's 267 transformed GI proxies fell through to the flat-gray analytic fallback. Separately, the software radiance-cache bake was light-source-only: downward miss rays returned ~black, i.e. no ground bounce at all.

Fixes

  1. World AABBs in instance data (all four shader layout mirrors + CPU fill from the scene's world-bounds pass, sentinel-guarded). The SDF broad-phase and card projection now use them; HW paths keep the object-space boxes + hit.world_to_object, unchanged.
  2. Smallest containing box wins — discovered during validation: the ±140 m terrain proxy contains every hit in the arena, and its mostly-empty side cards were actively darkening bounce (measured: GI-on read darker than GI-off at the ground-shadow rect before this).
  3. WSRC ground-bounce term for below-horizon octels: scene-average instance albedo × sun-shadowed irradiance + half sky, fed via a new uniform lane (scene average computed in the existing instance-data walk).

Measured honesty (GI pose A/B on the live game, sky-normalized, settled)

ship intensity 1.0 intensity 4.0
shaded receivers Δluma ≤1% (noise) +1.4–2.1%
hue (G/R at wall base) unchanged unchanged (0.9456 vs 0.9460)

The data path is now structurally correct, but visible colored bounce on the SW tier is capped downstream — probe resolve magnitude, the composite's AO multiply landing on exactly the shaded receivers, and hit-rate/radius at the receivers. EN-023 stays open, now pointed at the resolve/integration stage with this data. Decision D2-B (disable SSGI on iGPU and bank ~1.6 ms) remains reasonable until that lands.

Suite green: 99 lib + 7 golden.

Round-2 audit F4: on non-RT adapters (the dev 760M) SSGI's SDF path
degraded every transformed instance to flat gray and the SW radiance
cache was light-source-only — colored bounce structurally impossible.

Fixed in this PR:
- instance data now carries WORLD-space AABBs alongside the object-
  space ones (all four shader layout mirrors updated). The SDF broad-
  phase compares its world-space clipmap hits against the world boxes
  — the old object-space comparison only ever matched assets whose
  vertices were already in world space (Sponza). HW paths keep using
  the object-space boxes with hit.world_to_object, unchanged.
- broad-phase picks the SMALLEST containing box, not the first: the
  shooter's +/-140 m terrain proxy otherwise swallowed every hit
  (walls and trees included) and its mostly-empty side cards actively
  darkened the bounce.
- the SW WSRC bake gains a ground-bounce term for below-horizon
  octels (scene-average instance albedo x sun-shadowed irradiance +
  half sky) — it previously returned ~black for every downward miss
  ray, dropping the strongest real bounce source entirely.

Measured honesty (GI pose A/B, sky-normalized, settled):
- ship intensity 1.0: deltas within noise (<=1%), hue unchanged
- intensity 4.0:      +1.4-2.1% luma in shaded receivers, hue still
                      unchanged (G/R 0.9456 vs 0.9460)
The data path is now correct, but visible colored bounce on the SW
tier remains capped downstream (probe resolve magnitude, composite AO
multiply on exactly the shaded receivers, radius/hit-rate at the
receivers). EN-023 stays open pointing at the resolve/integration
stage; decision D2-B (bank the ~1.6 ms on iGPU) remains sensible until
that lands.

Suite green (99 lib + 7 golden). Boot-smoked at 4K; A/B runs above
were on the live game.
@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7e0cfa2e-dd21-4cd9-a7a1-1705373ada1d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/en023-gi-sw-cards

Comment @coderabbitai help to get the list of available commands.

@proggeramlug

Copy link
Copy Markdown
Contributor Author

Landed in main via the round-2 consolidation merge (#83). All commits from this branch are now on main; closing as merged-through-integration.

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.

1 participant