gpu: add an opt-in history limiter for overbright reflections #30

Closed
github-bot wants to merge 1 commit from github-bot/gh-30 into main AGit
Owner

@⁠oscarrc91 on GitHub · 2026-12-03 16:53 UTC · original
oscarrc91:fix/reflection-history-limit → main · +84 −9 · 4 files · 1 commits · closed without merging

With ray tracing disabled, excessive reflected light in the title's history can leave eyes looking white or luminous. This adds an opt-in reflection-history limiter; the player who tested our local build on an RX 9070 XT confirmed that the white-eye defect disappeared with VICTORY_REFLECT_HISTORY_MOST=0.5 and RT still disabled.

The limiter runs after the specifically identified CS_UpdateHistory_e877ef6e_Wrapped dispatch. It bounds brightness relative to the ambient estimate and reduces strongly saturated contamination in the packed history. It does not replace ReVIctory's existing directional reflection-resolve pass or enable ray tracing.

  • Only the verified root 1 / offset 40 history UAV is selected. Require a non-empty, non-array 2D R32_UINT view containing packed R9G9B9E5 data; similarly named history shaders are left alone.
  • Use the existing post-dispatch path, including indirect dispatches, with UAV barriers around the limiter.
  • Add F1 → Lighting → Indoor reflections → Reflection history limit, with reset/live-setting support. The default is 0 (off); 0.5 is the tested value, not a new global default.

This is a targeted visual workaround, not a complete correction of the title's lighting model. A low limit can also darken legitimate bright reflections.

Validation

  • Isolated branch based on 631b2ed4f2c3e41b7115198913c857a9310389c7.
  • cargo test --offline --locked --release -p victory-gpu --lib ambient::tests -- --test-threads=1 --nocapture
  • cargo test --offline --locked --release -p victory-gpu --lib live::tests -- --test-threads=1 --nocapture
  • Results: ambient 9 passed, 1 ignored (the ignored test requires the title's containers); live settings 2 passed.
  • The GPU pass test is run with VICTORY_REQUIRE_GPU_TEST=1 and VICTORY_D3D12_ADAPTER=AMD Radeon RX 9070 XT, so unavailable hardware cannot silently pass that check.
  • Gameplay confirmation was provided by the player on Windows, RX 9070 XT / Ryzen 7 7800X3D / 32 GB RAM, FSR 4 and FG enabled, RT disabled. That local build also contained #9 and the sampler-heap guard from #24; those changes are not included here. No FPS improvement is claimed.

Attribution and existing work

Adapted from guard_reflect in ProjectLeonida/mandy at 3fdfbaa, with ReVIctory-specific dispatch selection, resource checks and live controls. The donor's hardware-RT work is not part of this PR.

Reviewed the existing open and closed ReVIctory PRs before opening this. The helper-lane correction in #14 and the tree/descriptor work in #29 address different paths; neither is duplicated here.

**@⁠oscarrc91** on GitHub · 2026-12-03 16:53 UTC · [original](https://github.com/ReTerryDavis/ReVIctory/pull/30) `oscarrc91:fix/reflection-history-limit` → `main` · +84 −9 · 4 files · 1 commits · closed without merging With ray tracing disabled, excessive reflected light in the title's history can leave eyes looking white or luminous. This adds an **opt-in reflection-history limiter**; the player who tested our local build on an RX 9070 XT confirmed that the white-eye defect disappeared with `VICTORY_REFLECT_HISTORY_MOST=0.5` and RT still disabled. The limiter runs after the specifically identified `CS_UpdateHistory_e877ef6e_Wrapped` dispatch. It bounds brightness relative to the ambient estimate and reduces strongly saturated contamination in the packed history. It does not replace ReVIctory's existing directional reflection-resolve pass or enable ray tracing. - Only the verified root 1 / offset 40 history UAV is selected. Require a non-empty, non-array 2D `R32_UINT` view containing packed R9G9B9E5 data; similarly named history shaders are left alone. - Use the existing post-dispatch path, including indirect dispatches, with UAV barriers around the limiter. - Add **F1 → Lighting → Indoor reflections → Reflection history limit**, with reset/live-setting support. The default is **0 (off)**; `0.5` is the tested value, not a new global default. This is a targeted visual workaround, not a complete correction of the title's lighting model. A low limit can also darken legitimate bright reflections. ### Validation - Isolated branch based on `631b2ed4f2c3e41b7115198913c857a9310389c7`. - `cargo test --offline --locked --release -p victory-gpu --lib ambient::tests -- --test-threads=1 --nocapture` - `cargo test --offline --locked --release -p victory-gpu --lib live::tests -- --test-threads=1 --nocapture` - Results: ambient **9 passed, 1 ignored** (the ignored test requires the title's containers); live settings **2 passed**. - The GPU pass test is run with `VICTORY_REQUIRE_GPU_TEST=1` and `VICTORY_D3D12_ADAPTER=AMD Radeon RX 9070 XT`, so unavailable hardware cannot silently pass that check. - Gameplay confirmation was provided by the player on Windows, RX 9070 XT / Ryzen 7 7800X3D / 32 GB RAM, FSR 4 and FG enabled, RT disabled. That local build also contained #9 and the sampler-heap guard from #24; those changes are **not included here**. No FPS improvement is claimed. ### Attribution and existing work Adapted from `guard_reflect` in [ProjectLeonida/mandy at 3fdfbaa](https://github.com/ProjectLeonida/mandy/blob/3fdfbaa46f8a9811d6521ce6017b4094765c15de/d3d12/crates/leonida-gpu/src/ambient.rs), with ReVIctory-specific dispatch selection, resource checks and live controls. The donor's hardware-RT work is not part of this PR. Reviewed the existing open and closed ReVIctory PRs before opening this. The helper-lane correction in #14 and the tree/descriptor work in #29 address different paths; neither is duplicated here.
Bound excessive reflection history after the verified UpdateHistory pass,
with a live F1 control and a default of zero. The tested value of 0.5
removed white-eye reflections on an RX 9070 XT with ray tracing disabled.

Adapted from guard_reflect in ProjectLeonida/mandy at
3fdfbaa46f8a9811d6521ce6017b4094765c15de (GPL-3.0-or-later).
Keep ReVIctory's directional reflection pass and resource checks.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-03 17:01:30 +00:00
github-bot closed this pull request 2026-12-04 02:03:18 +00:00
Author
Owner

@⁠ReTerryDavis on GitHub · 2026-12-04 02:02 UTC · original

Closing because ambient.rs was overhauled in a094f8b, which now handles indoor overbright reflections and glowing eyes using the Scene Stencil IS_INTERIOR mask and source-level RayMiss cleanup without dimming outdoor reflections. Thanks for the clean port!

**@⁠ReTerryDavis** on GitHub · 2026-12-04 02:02 UTC · [original](https://github.com/ReTerryDavis/ReVIctory/pull/30#issuecomment-7398503357) Closing because `ambient.rs` was overhauled in `a094f8b`, which now handles indoor overbright reflections and glowing eyes using the Scene Stencil `IS_INTERIOR` mask and source-level `RayMiss` cleanup without dimming outdoor reflections. Thanks for the clean port!

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.