Ambient: bound the sky's light in reflections where the miss program has no depth #63

Open
github-bot wants to merge 1 commit from github-bot/gh-63 into main AGit
Owner

@⁠wasonidas on GitHub · 2026-11-27 15:39 UTC · original
wasonidas:fix/reflections-no-depth-bound → main · +398 −24 · 3 files · 1 commits · open

Problem

On an RTX 5080 (Series S and Series X profiles) CS_RayMiss_de6b91a6 has a 1x1 texture at its depth's place in every frame of the world, so the reflections estimate (VICTORY_AMBIENT_SPECULAR) never ran for it: indoors, floors and glass mirrored the sky.

The alpha layer (glass, decals, paper on a wall) takes the sky's light twice when its rays find nothing, from CS_DeferredFallbacksAlpha_SkyProbe and from CS_RayMiss, into the image CS_TemporalResolve1_Alpha reads. Paper on the wall of the first playable room showed the sky at 10 to 30 where the room around sends out 0.01 to 0.1.

Change

  • Where the miss program has no depth of the picture, the opaque layer keeps the title's sky light only up to a multiple (6) of the light around: VICTORY_AMBIENT_SPECULAR_NO_DEPTH=<multiple>, 0 leaves the title's sky light. It acts only with VICTORY_AMBIENT_SPECULAR on.
  • The alpha layer gets the same bound everywhere: VICTORY_AMBIENT_SPECULAR_ALPHA unset or bound[:<multiple>]; 1 takes the estimate as opaque surfaces do, 0 leaves it as the title has it. A bound needs neither the surface's depth nor its normal, so it also works on water, where the estimate cannot be used.
  • "The light around" is the geometric mean of what the picture's cells send out, not the plain mean: a window with the sunset in it is a third of a cell's picture and 200 times the room.
  • The miss program's tables are listed again at its 1024th and 8192nd unmatched dispatch.
  • Two small things that came in the same commit: VICTORY_CAPTURE_WORLD_EVERY=<frames> sets how often a frame of the world is saved in the diagnostics build (8, as before; a saved frame takes 45 to 55 ms more, which was the 95th percentile of every run measured with captures), and VICTORY_AMBIENT_SECOND caps the resolve's second image of light (a probe, off unless asked for).

Outdoors the light around is of the sky's order and the bound does little; indoors it takes the sky away.

Relation to #29

#29 drops violet leftovers in the ambient raise. This bounds the sky's light in reflections, another path; it applies beside #29's lines without touching them.

Measured

RTX 5080, Ryzen 7 9800X3D, 32 GB, Series X profile, 2560x1440, DLSS Quality, diagnostics build, 294 s unattended run of the prologue with this change:

device removed / out-of-memory lines 0 / 0
cell (135-145 s) 22.4 FPS, p50 35.1 ms
route (199-226 s) 27.0 FPS, p50 34.4 ms, p95 54.4 ms
peak commit / dedicated VRAM 30.9 GiB / 13.05 GiB

This is a picture fix and comes with no frame-rate claim: there was no A/B of this change alone, and the cost of the two compute passes it adds (bound, cap) was not isolated. The run above saved every 8th frame, each about 50 ms.

Checks

  • Cherry-picked on main (d12eb1b2) without conflicts.
  • cargo check --workspace --all-targets --locked: passes.
  • cargo test -p victory-gpu --lib -- ambient::tests capture::tests draw::tests (card-free ones, including the three new settings tests) and cargo test -p xtask (asset policy): pass.
  • Not run on this branch: ambient::tests::the_passes_build, which compiles the passes on a card. No GPU run was made on top of current main; the measurements above are from our RTX 5080 branch, whose base is this repository's 9d6300fa.
**@⁠wasonidas** on GitHub · 2026-11-27 15:39 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/63) `wasonidas:fix/reflections-no-depth-bound` → `main` · +398 −24 · 3 files · 1 commits · open ## Problem On an RTX 5080 (Series S and Series X profiles) `CS_RayMiss_de6b91a6` has a 1x1 texture at its depth's place in every frame of the world, so the reflections estimate (`VICTORY_AMBIENT_SPECULAR`) never ran for it: indoors, floors and glass mirrored the sky. The alpha layer (glass, decals, paper on a wall) takes the sky's light twice when its rays find nothing, from `CS_DeferredFallbacksAlpha_SkyProbe` and from `CS_RayMiss`, into the image `CS_TemporalResolve1_Alpha` reads. Paper on the wall of the first playable room showed the sky at 10 to 30 where the room around sends out 0.01 to 0.1. ## Change - Where the miss program has no depth of the picture, the opaque layer keeps the title's sky light only up to a multiple (6) of the light around: `VICTORY_AMBIENT_SPECULAR_NO_DEPTH=<multiple>`, `0` leaves the title's sky light. It acts only with `VICTORY_AMBIENT_SPECULAR` on. - The alpha layer gets the same bound everywhere: `VICTORY_AMBIENT_SPECULAR_ALPHA` unset or `bound[:<multiple>]`; `1` takes the estimate as opaque surfaces do, `0` leaves it as the title has it. A bound needs neither the surface's depth nor its normal, so it also works on water, where the estimate cannot be used. - "The light around" is the geometric mean of what the picture's cells send out, not the plain mean: a window with the sunset in it is a third of a cell's picture and 200 times the room. - The miss program's tables are listed again at its 1024th and 8192nd unmatched dispatch. - Two small things that came in the same commit: `VICTORY_CAPTURE_WORLD_EVERY=<frames>` sets how often a frame of the world is saved in the diagnostics build (8, as before; a saved frame takes 45 to 55 ms more, which was the 95th percentile of every run measured with captures), and `VICTORY_AMBIENT_SECOND` caps the resolve's second image of light (a probe, off unless asked for). Outdoors the light around is of the sky's order and the bound does little; indoors it takes the sky away. ## Relation to #29 #29 drops violet leftovers in the ambient `raise`. This bounds the sky's light in reflections, another path; it applies beside #29's lines without touching them. ## Measured RTX 5080, Ryzen 7 9800X3D, 32 GB, Series X profile, 2560x1440, DLSS Quality, diagnostics build, 294 s unattended run of the prologue with this change: | | | |---|---| | device removed / out-of-memory lines | 0 / 0 | | cell (135-145 s) | 22.4 FPS, p50 35.1 ms | | route (199-226 s) | 27.0 FPS, p50 34.4 ms, p95 54.4 ms | | peak commit / dedicated VRAM | 30.9 GiB / 13.05 GiB | This is a picture fix and comes with no frame-rate claim: there was no A/B of this change alone, and the cost of the two compute passes it adds (`bound`, `cap`) was not isolated. The run above saved every 8th frame, each about 50 ms. ## Checks - Cherry-picked on `main` (`d12eb1b2`) without conflicts. - `cargo check --workspace --all-targets --locked`: passes. - `cargo test -p victory-gpu --lib -- ambient::tests capture::tests draw::tests` (card-free ones, including the three new settings tests) and `cargo test -p xtask` (asset policy): pass. - Not run on this branch: `ambient::tests::the_passes_build`, which compiles the passes on a card. No GPU run was made on top of current `main`; the measurements above are from our RTX 5080 branch, whose base is this repository's `9d6300fa`.
On the RTX 5080 profile (Series S and X) CS_RayMiss_de6b91a6 has a 1x1
texture at its depth's place in every frame of the world, so the estimate
for reflections never ran: floors and glass indoors mirrored the sky. The
opaque layer there, and the alpha layer everywhere unless asked otherwise,
now keep the title's sky light up to six times the geometric mean of what
the picture sends out (VICTORY_AMBIENT_SPECULAR_NO_DEPTH,
VICTORY_AMBIENT_SPECULAR_ALPHA). The miss program's tables are listed again
at its 1024th and 8192nd unmatched dispatch.

VICTORY_CAPTURE_WORLD_EVERY sets how often a frame of the world is saved
(8 as before): a saved frame takes about 50 ms more, which was the 95th
percentile of every run measured with captures.

VICTORY_AMBIENT_SECOND caps the resolve's second image of light; a probe,
off unless asked for (it is not where the violet paper comes from).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 15:50:29 +00:00
Author
Owner

@⁠1tsethan on GitHub · 2026-11-27 23:00 UTC · original

Independent Windows validation of PR #63.

Tested commit: f60296e7ef1722c0d624ba7f46b27bf09459ebdd.

cargo test --locked -p victory-gpu ambient::tests:: -- --nocapture --test-threads=1

Exit: 0.

  • test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 446 filtered out; finished in 1.20s

Independent verification with OpenAI Codex assistance. Windows 11 Pro build 26200; Rust 1.98.1 MSVC; Windows SDK libraries from Microsoft.Windows.SDK.CPP.x64 10.0.28000.2957. Test harness used an RTX 3070 Ti / AMD integrated-GPU host; adapter identity was not captured for every test. These are focused checks on the stated PR commit, not gameplay, FPS, or a merged-main integration result.

**@⁠1tsethan** on GitHub · 2026-11-27 23:00 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/63#issuecomment-7229799304) Independent Windows validation of PR #63. Tested commit: `f60296e7ef1722c0d624ba7f46b27bf09459ebdd`. `cargo test --locked -p victory-gpu ambient::tests:: -- --nocapture --test-threads=1` Exit: **0**. - test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 446 filtered out; finished in 1.20s Independent verification with OpenAI Codex assistance. Windows 11 Pro build 26200; Rust 1.98.1 MSVC; Windows SDK libraries from Microsoft.Windows.SDK.CPP.x64 10.0.28000.2957. Test harness used an RTX 3070 Ti / AMD integrated-GPU host; adapter identity was not captured for every test. These are focused checks on the stated PR commit, not gameplay, FPS, or a merged-main integration result. <!-- victory-native-validation-20261128 -->
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/draw.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/63/head:github-bot/gh-63'
git switch 'github-bot/gh-63'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-63'
git switch 'github-bot/gh-63'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-63'
git switch 'github-bot/gh-63'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-63'
git switch 'main'
git merge --squash 'github-bot/gh-63'
git switch 'main'
git merge --ff-only 'github-bot/gh-63'
git switch 'main'
git merge 'github-bot/gh-63'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.