Light stand-in holds the traced reflections to the light around (VICTORY_AMBIENT_REFLECT): eyes, glasses and panes no longer show the open sky indoors #314

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

@⁠Serph91P on GitHub · 2026-11-26 15:49 UTC · original
Serph91P:ambient-reflect-hold → main · +410 −11 · 7 files · 1 commits · open

With the structure builder off, every reflection ray misses and the title takes its environment cube instead: the open sky, unoccluded, indoors too. A cornea showed a near-white patch about three times brighter than the face around it; glasses and window panes showed the outdoors through the walls. This holds the traced reflections to the light around, the way the stand-in already raises the diffuse light. One commit on c9c932c.

What it does

  • ambient.rs: a new role for the two programs that resolve the reflections (CS_TemporalResolve2_Opaque_*, CS_TemporalResolve1_Alpha_*). Right after each, one pass over its image (R9G9B9E5 as 32-bit integers): a texel brighter than a multiple of the stand-in's estimate around it (the mean at the four points about it, with a fifth of the room's slow mean, as the diffuse light has it; the constant in constant: mode) is scaled down to that, hue kept.
  • VICTORY_AMBIENT_REFLECT=<multiple>: unset 1, 0 or off the title's own reflections. Like the rest of the stand-in it acts only while VICTORY_AMBIENT is set and the builder does not run.
  • draw.rs: the stand-in's hook also runs after indirect dispatches, because both programs are dispatched so.
  • victory replay --reflect <shader>:<table>+<descriptor>:<multiple> puts the same pass into a replayed frame, which is how it was checked before it ran in the title.

That reflections can be held to the ambient light, and the switch's name, are beloooo's (VIctory-Belobug-AMD 44dcd437). There it is after CS_UpdateHistory and to a part of the constant; in the frame looked at here that program runs after the copy the transparent materials read, so the hold is before that copy, and to the frame's own estimate.

Two things to decide

  • It is on whenever VICTORY_AMBIENT is in use (so with play.ps1). If you would rather have it off until you have looked at it on your card, say so and I will make unset mean off.
  • The hook after indirect dispatches is new for the other roles too. In the frame looked at they are all dispatched directly.

Tested (RX 7900 XTX, RADV Mesa 26.3.1, vkd3d-proton 71cae091, Proton Experimental, builder off)

  • On a recorded interior frame, with the multiple at 2, 1 and 0.5: at 1 both eyes lose the patch and look natural with a small highlight left; a door's pane shows a dim room instead of glowing; 3.3% of the picture's pixels change by more than 6/255, all on panes, eyes, glossy floor and metal. At 2 a faint patch is left, at 0.5 the eyes are dull.
  • In the title: eyes, drinking glasses and panes look right to the observer in several rooms; the log has reflections held to a multiple of the light around and the role's line; frame times as before (64-75 ms against 63-68 ms without it, single runs).
  • This branch alone builds for x86_64-pc-windows-msvc; cargo xtask policy and cargo test -p xtask pass; the added lines are rustfmt-clean (older differences in the touched files are unchanged).

Not tested: Windows, NVIDIA, outdoor scenes, constant: mode in the title. The victory-gpu unit tests were not run (they need Windows).

What it does not do: it bounds the reflection, it does not stand in for one (no direction, no parallax). A glass globe with many small highlights still sparkles here, and the glass of a wire-mesh window is as before.

No game data in the commit.

🤖 Generated with Claude Code

**@⁠Serph91P** on GitHub · 2026-11-26 15:49 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/314) `Serph91P:ambient-reflect-hold` → `main` · +410 −11 · 7 files · 1 commits · open With the structure builder off, every reflection ray misses and the title takes its environment cube instead: the open sky, unoccluded, indoors too. A cornea showed a near-white patch about three times brighter than the face around it; glasses and window panes showed the outdoors through the walls. This holds the traced reflections to the light around, the way the stand-in already raises the diffuse light. One commit on c9c932c. **What it does** - `ambient.rs`: a new role for the two programs that resolve the reflections (`CS_TemporalResolve2_Opaque_*`, `CS_TemporalResolve1_Alpha_*`). Right after each, one pass over its image (R9G9B9E5 as 32-bit integers): a texel brighter than a multiple of the stand-in's estimate around it (the mean at the four points about it, with a fifth of the room's slow mean, as the diffuse light has it; the constant in `constant:` mode) is scaled down to that, hue kept. - `VICTORY_AMBIENT_REFLECT=<multiple>`: unset 1, `0` or `off` the title's own reflections. Like the rest of the stand-in it acts only while `VICTORY_AMBIENT` is set and the builder does not run. - `draw.rs`: the stand-in's hook also runs after indirect dispatches, because both programs are dispatched so. - `victory replay --reflect <shader>:<table>+<descriptor>:<multiple>` puts the same pass into a replayed frame, which is how it was checked before it ran in the title. That reflections can be held to the ambient light, and the switch's name, are beloooo's (VIctory-Belobug-AMD 44dcd437). There it is after `CS_UpdateHistory` and to a part of the constant; in the frame looked at here that program runs after the copy the transparent materials read, so the hold is before that copy, and to the frame's own estimate. **Two things to decide** - It is on whenever `VICTORY_AMBIENT` is in use (so with `play.ps1`). If you would rather have it off until you have looked at it on your card, say so and I will make unset mean off. - The hook after indirect dispatches is new for the other roles too. In the frame looked at they are all dispatched directly. **Tested** (RX 7900 XTX, RADV Mesa 26.3.1, vkd3d-proton 71cae091, Proton Experimental, builder off) - On a recorded interior frame, with the multiple at 2, 1 and 0.5: at 1 both eyes lose the patch and look natural with a small highlight left; a door's pane shows a dim room instead of glowing; 3.3% of the picture's pixels change by more than 6/255, all on panes, eyes, glossy floor and metal. At 2 a faint patch is left, at 0.5 the eyes are dull. - In the title: eyes, drinking glasses and panes look right to the observer in several rooms; the log has `reflections held to a multiple of the light around` and the role's line; frame times as before (64-75 ms against 63-68 ms without it, single runs). - This branch alone builds for `x86_64-pc-windows-msvc`; `cargo xtask policy` and `cargo test -p xtask` pass; the added lines are rustfmt-clean (older differences in the touched files are unchanged). **Not tested:** Windows, NVIDIA, outdoor scenes, `constant:` mode in the title. The victory-gpu unit tests were not run (they need Windows). **What it does not do:** it bounds the reflection, it does not stand in for one (no direction, no parallax). A glass globe with many small highlights still sparkles here, and the glass of a wire-mesh window is as before. No game data in the commit. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Without the builder every reflection ray misses and takes the title's
environment cube: a cornea near-white, a door's pane showing the outdoors
through the walls. Right after the two programs that resolve the
reflections (CS_TemporalResolve2_Opaque_*, CS_TemporalResolve1_Alpha_*;
before the copy the transparent materials read) each texel is held to a
multiple of the stand-in's estimate around it, hue kept: one pass over the
picture's texels each. The stand-in's hook also runs after indirect
dispatches now, as these two programs are dispatched so.

The idea of holding the reflections to the ambient light and the switch's
name are beloooo's (VIctory-Belobug-AMD 44dcd437, GPL-3.0-or-later).

victory replay --reflect <shader>:<table>+<descriptor>:<multiple> puts the
same pass into a recorded frame. On capture-2, multiple 1: natural eyes,
see-through panes, 3.3% of the picture changed (panes, eyes, the glossy
floor's patches, a metal locker); 2 leaves a faint tinted patch on the
eye, 0.5 is close to no reflection at all.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 15:54:08 +00:00
Author
Owner

@⁠DTsordas on GitHub · 2026-11-26 18:31 UTC · original

Tested on an RX 9060 XT (RDNA 4, Navi 44): a visible improvement, and no frame-time cost.

Machine: Radeon RX 9060 XT 16 GB (0x7590), driver 32.0.32015.7029 (26.10.1) · Ryzen 5 5600X · 64 GB · Windows 11 26300.
Build: c9c932c + this PR (6c7e3a8) + #357 (the RDNA 4 compiler fix, so the title runs on this card), diag, all shaders translated ahead and pipelines warmed. scripts\play.ps1 settings, Series X, VICTORY_PORT_CONSTANTS/DESCRIPTORS/CBV/GUARD/JOURNAL=1, builder off (no -RayTracing).

How: so that both sides could be seen in the same spot, I wired the switch into the A/B phases. This was a local test hook only: ambient.rs skips the Role::Reflect pass while crate::ab::pick("VICTORY_AMBIENT_REFLECT") == Some(false). The run used VICTORY_AB=10,VICTORY_AMBIENT_REFLECT, so the hold turns on and off every 10 s while the player stands still. The log shows the pass running: reflections held to a multiple of the light around (VICTORY_AMBIENT_REFLECT) held=1.0, role=Reflect size=[2560, 1440].

Picture: with the hold on, the picture is better. The player watched it switch back and forth at the same spot. The clearest case is the window in the prison corridor, with the camera standing still:

  • Hold off: the pane is filled with an orange sunset glow, the open sky outdoors reflected indoors. It covers the room behind the glass; only a lamp and a window frame show through.
  • Hold on: the pane is clear. The room behind it shows, with its bars, ceiling light and the person standing in it, and the glass reflects only as much as the room's own light. Lucia's face beside it is lit the same in both.

It came out the same at every switch the player watched there (several phases each way, from two camera angles): off, the sunset glow, and once with pieces of another view smeared through it; on, the door with its bars and its A101 sign, and the room behind it.

Glossy floors went the same way: without the hold they look wet, over-bright and grainy (the diner counter and floor, the corridor floor). No screenshots, per the asset policy.

Frame time (A/B phases in the world, same spot, ~2,700-3,200 draws a frame):

Phase Hold Mean Median
6 off 150.4 ms 139.5
7 on 138.5 ms 115.5
8 off 144.0 ms 129.4
9 on 140.6 ms 123.6
10 off 139.1 ms 121.3

Over the whole session, 20 phases in the world (10 each way, the player moving between spots): off 104.9 ms mean / 98.0 ms median, on 102.3 ms / 93.7 ms. No cost I can measure: the "on" phases are within the run's noise of the "off" ones, if anything slightly lower. No device removal and no compiler fault in the session.

AI-assisted (Claude Code).

**@⁠DTsordas** on GitHub · 2026-11-26 18:31 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/314#issuecomment-7200565929) **Tested on an RX 9060 XT (RDNA 4, Navi 44): a visible improvement, and no frame-time cost.** **Machine**: Radeon RX 9060 XT 16 GB (`0x7590`), driver 32.0.32015.7029 (26.10.1) · Ryzen 5 5600X · 64 GB · Windows 11 26300. **Build**: `c9c932c` + this PR (`6c7e3a8`) + #357 (the RDNA 4 compiler fix, so the title runs on this card), `diag`, all shaders translated ahead and pipelines warmed. `scripts\play.ps1` settings, Series X, `VICTORY_PORT_CONSTANTS/DESCRIPTORS/CBV/GUARD/JOURNAL=1`, builder off (no `-RayTracing`). **How**: so that both sides could be seen in the same spot, I wired the switch into the A/B phases. This was a local test hook only: `ambient.rs` skips the `Role::Reflect` pass while `crate::ab::pick("VICTORY_AMBIENT_REFLECT") == Some(false)`. The run used `VICTORY_AB=10,VICTORY_AMBIENT_REFLECT`, so the hold turns on and off every 10 s while the player stands still. The log shows the pass running: `reflections held to a multiple of the light around (VICTORY_AMBIENT_REFLECT) held=1.0`, `role=Reflect size=[2560, 1440]`. **Picture**: with the hold on, the picture is better. The player watched it switch back and forth at the same spot. The clearest case is the window in the prison corridor, with the camera standing still: - **Hold off**: the pane is filled with an orange sunset glow, the open sky outdoors reflected indoors. It covers the room behind the glass; only a lamp and a window frame show through. - **Hold on**: the pane is clear. The room behind it shows, with its bars, ceiling light and the person standing in it, and the glass reflects only as much as the room's own light. Lucia's face beside it is lit the same in both. It came out the same at every switch the player watched there (several phases each way, from two camera angles): off, the sunset glow, and once with pieces of another view smeared through it; on, the door with its bars and its `A101` sign, and the room behind it. Glossy floors went the same way: without the hold they look wet, over-bright and grainy (the diner counter and floor, the corridor floor). No screenshots, per the asset policy. **Frame time** (A/B phases in the world, same spot, ~2,700-3,200 draws a frame): | Phase | Hold | Mean | Median | |---|---|---|---| | 6 | off | 150.4 ms | 139.5 | | 7 | on | 138.5 ms | 115.5 | | 8 | off | 144.0 ms | 129.4 | | 9 | on | 140.6 ms | 123.6 | | 10 | off | 139.1 ms | 121.3 | Over the whole session, 20 phases in the world (10 each way, the player moving between spots): off 104.9 ms mean / 98.0 ms median, on 102.3 ms / 93.7 ms. No cost I can measure: the "on" phases are within the run's noise of the "off" ones, if anything slightly lower. No device removal and no compiler fault in the session. AI-assisted (Claude Code).
Author
Owner

@⁠UwUCammie on GitHub · 2026-11-26 18:52 UTC · original

I ran this on the RX 7900 XT with RADV 26.3.1. In the same diner close-up, the blue-white patches over both eyes went away and the irises were visible. In another matched shot, the mean brightness of a floor patch dropped from 59 to 24 on a 0–255 scale. The ceiling lamp read 177 and 175 in those frames. Both starts used the same executable and warm caches at 720p, with ambient at 0.8 and the reflection limit at 0 or 1. The enabled run recorded the pass at 853×480. I put the AMD backport in jtrudeau1530#14.

**@⁠UwUCammie** on GitHub · 2026-11-26 18:52 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/314#issuecomment-7200952238) I ran this on the RX 7900 XT with RADV 26.3.1. In the same diner close-up, the blue-white patches over both eyes went away and the irises were visible. In another matched shot, the mean brightness of a floor patch dropped from 59 to 24 on a 0–255 scale. The ceiling lamp read 177 and 175 in those frames. Both starts used the same executable and warm caches at 720p, with ambient at 0.8 and the reflection limit at 0 or 1. The enabled run recorded the pass at 853×480. I put the AMD backport in [jtrudeau1530#14](https://github.com/jtrudeau1530/VIctory-7900XTX/pull/14).
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/ambient.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/314/head:github-bot/gh-314'
git switch 'github-bot/gh-314'

Merge

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