GPU: the least indirect light where the title's ray-traced probes have none #116

Open
starnotes-xj wants to merge 1 commit from upstream-pr/116 into main
starnotes-xj commented 2026-11-25 13:06:10 +00:00 (Migrated from github.com)
First-time contributor

Imported from Zettrox/ztrx. Originally posted by starnotes-xj on 2026-11-25T12:35:03Z.


The title's indirect diffuse light comes from probes filled by tracing rays, which do not run here: CS_ScreenProbes_TemporalResolve leaves whatever its unwritten inputs held, so anything the sun does not reach directly is black — and in the prologue it is not even black but blown out, because the title's exposure reads that garbage.

This replaces the resolve's output with a constant right after it runs (raised, not added), so the title's own lighting still applies the surfaces' colours and its exposure sees a sane average.

Ported from Belobug's AMD fork (belobug/VIctory-Belobug-AMD, commit 4f45ab8): the same pass — root constants (level, tint) and a UAV of the R9G9B9E5 light texture, one dispatch per resolve. Here it is hooked into State::dispatch, and the list's cached heap, root signature and pipeline are invalidated so the next draw sets its own.

VICTORY_AMBIENT=<level> sets the light (0.6 by default, 0 none, off keeps the title's output).

Measured (RTX 4060 Laptop, 8 GB, NVIDIA 621.14)

  • Prologue cell and the opening cutscene with VICTORY_AMBIENT=0: the whole frame washes out to white; only subtitles are readable.
  • The same frames at the default 0.6: exposed image — dark corners readable, faces lit, the window no longer the only thing visible.
  • 2 fps in the world either way (the pass is 1 dispatch of 2560x1440 / 8x8).

Still black after this: eyes, and surfaces lit only by the title's reflections (those rays do not run yet).

Checks

  • cargo test -p victory-gpu --release: 112 passed, 0 failed (the new ambient_pass_builds needs a D3D12 device and returns early without one).
  • cargo clippy --release -p victory-gpu: clean.
  • In-game: the log line ambient light level=0.6 width=2560 height=1440 and the diff in the images above.
<!-- greyfinch-sync:Zettrox/ztrx:issue:6604595484 --> Imported from [Zettrox/ztrx](https://github.com/Zettrox/ztrx/pull/116). Originally posted by [starnotes-xj](https://github.com/starnotes-xj) on 2026-11-25T12:35:03Z. --- The title's indirect diffuse light comes from probes filled by tracing rays, which do not run here: `CS_ScreenProbes_TemporalResolve` leaves whatever its unwritten inputs held, so anything the sun does not reach directly is black — and in the prologue it is not even black but blown out, because the title's exposure reads that garbage. This replaces the resolve's output with a constant right after it runs (raised, not added), so the title's own lighting still applies the surfaces' colours and its exposure sees a sane average. Ported from Belobug's AMD fork (`belobug/VIctory-Belobug-AMD`, commit 4f45ab8): the same pass — root constants (level, tint) and a UAV of the R9G9B9E5 light texture, one dispatch per resolve. Here it is hooked into `State::dispatch`, and the list's cached heap, root signature and pipeline are invalidated so the next draw sets its own. `VICTORY_AMBIENT=<level>` sets the light (0.6 by default, `0` none, `off` keeps the title's output). ## Measured (RTX 4060 Laptop, 8 GB, NVIDIA 621.14) - Prologue cell and the opening cutscene with `VICTORY_AMBIENT=0`: the whole frame washes out to white; only subtitles are readable. - The same frames at the default 0.6: exposed image — dark corners readable, faces lit, the window no longer the only thing visible. - 2 fps in the world either way (the pass is 1 dispatch of 2560x1440 / 8x8). Still black after this: eyes, and surfaces lit only by the title's reflections (those rays do not run yet). ## Checks - `cargo test -p victory-gpu --release`: 112 passed, 0 failed (the new `ambient_pass_builds` needs a D3D12 device and returns early without one). - `cargo clippy --release -p victory-gpu`: clean. - In-game: the log line `ambient light level=0.6 width=2560 height=1440` and the diff in the images above.
ofc0urse commented 2026-11-25 14:11:04 +00:00 (Migrated from github.com)
Author
First-time contributor

Imported from Zettrox/ztrx. Originally posted by ofc0urse on 2026-11-25T13:15:01Z.


Confirmed on a second 8 GB NVIDIA card, on the newer fork tree.

RTX 4060 Ti 8 GB (driver 621.24), i5-14400F, 32 GB, Windows 11, diagnostics build, --console series-s. 89cc499 cherry-picked cleanly onto fxceless/victory-fork main at 0b0074e (with fxceless/victory-fork #610, #798, #823 and #834 also on top), default VICTORY_AMBIENT (0.6). The log shows ambient light level=0.6 width=1280 height=720.

With it, the cell after the window scene shows its walls, the blue window frame and bunks, the ceiling lamps and the guard at the door; the dayroom shows the inmates at the tables instead of black silhouettes. Without it (the same set on the two previous mains, 9376fd6 and f85101b) both rooms were dark apart from the sunlit patches. Faces are still dark in places, as you wrote.

20-minute run with an automated walk out of the cell: 175-265 ms a frame, no device loss.

🤖 Generated with Claude Code

<!-- greyfinch-sync:Zettrox/ztrx:comment:7163504003 --> Imported from [Zettrox/ztrx](https://github.com/Zettrox/ztrx/pull/116#issuecomment-7163504003). Originally posted by [ofc0urse](https://github.com/ofc0urse) on 2026-11-25T13:15:01Z. --- Confirmed on a second 8 GB NVIDIA card, on the newer fork tree. RTX 4060 Ti 8 GB (driver 621.24), i5-14400F, 32 GB, Windows 11, diagnostics build, `--console series-s`. `89cc499` cherry-picked cleanly onto fxceless/victory-fork `main` at `0b0074e` (with fxceless/victory-fork #610, #798, #823 and #834 also on top), default `VICTORY_AMBIENT` (0.6). The log shows `ambient light level=0.6 width=1280 height=720`. With it, the cell after the window scene shows its walls, the blue window frame and bunks, the ceiling lamps and the guard at the door; the dayroom shows the inmates at the tables instead of black silhouettes. Without it (the same set on the two previous mains, `9376fd6` and `f85101b`) both rooms were dark apart from the sunlit patches. Faces are still dark in places, as you wrote. 20-minute run with an automated walk out of the cell: 175-265 ms a frame, no device loss. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
starnotes-xj commented 2026-11-25 14:11:05 +00:00 (Migrated from github.com)
Author
First-time contributor

Imported from Zettrox/ztrx. Originally posted by starnotes-xj on 2026-11-25T13:40:54Z.


Thanks for the second 8 GB data point — the dayroom detail (inmates at the tables instead of silhouettes) is exactly what the pass is for.

On the faces still being dark: that is the next gap here too. The eye material has its own tiled-lighting programs (TL_PS_PBR_MATERIAL_EYE_*), and they do translate and run — the pass is drawn full-screen — so the darkness is in what those programs read (the bounce/reflection data the title's rays would fill), not a missing draw. The same run also showed seven PS_PuddleDetect and five shadowmask:CS_TraceShadowRays_* programs failing to translate on a descriptor read only as data; #127 fixes that class (40 programs of the pack, +35 pixel and +4 compute emitted), which is where the bounce data is meant to come from.

A useful next data point if you run again: a frame in direct sun with a character in shade, before and after #127, and whether puddles/reflections changed in the dayroom.

<!-- greyfinch-sync:Zettrox/ztrx:comment:7164132409 --> Imported from [Zettrox/ztrx](https://github.com/Zettrox/ztrx/pull/116#issuecomment-7164132409). Originally posted by [starnotes-xj](https://github.com/starnotes-xj) on 2026-11-25T13:40:54Z. --- Thanks for the second 8 GB data point — the dayroom detail (inmates at the tables instead of silhouettes) is exactly what the pass is for. On the faces still being dark: that is the next gap here too. The eye material has its own tiled-lighting programs (`TL_PS_PBR_MATERIAL_EYE_*`), and they do translate and run — the pass is drawn full-screen — so the darkness is in what those programs read (the bounce/reflection data the title's rays would fill), not a missing draw. The same run also showed seven `PS_PuddleDetect` and five `shadowmask:CS_TraceShadowRays_*` programs failing to translate on `a descriptor read only as data`; #127 fixes that class (40 programs of the pack, +35 pixel and +4 compute emitted), which is where the bounce data is meant to come from. A useful next data point if you run again: a frame in direct sun with a character in shade, before and after #127, and whether puddles/reflections changed in the dayroom.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/116:upstream-pr/116'
git switch 'upstream-pr/116'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/116'
git switch 'upstream-pr/116'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/116'
git switch 'upstream-pr/116'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/116'
git switch 'main'
git merge --squash 'upstream-pr/116'
git switch 'main'
git merge --ff-only 'upstream-pr/116'
git switch 'main'
git merge 'upstream-pr/116'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
Zettrox/ztrx!116
No description provided.