Reflections: no white grain on floors; frame gen limit when switched off; NaN scrub port #428

Merged
PsyloZ merged 3 commits from upstream-pr/428 into main 2026-11-28 19:39:39 +00:00
PsyloZ commented 2026-11-27 22:21:23 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by PsyloZ on 2026-11-27T22:21:23Z.


Three fixes found while playing on an RTX 4070 Ti (Windows 11, 32 GB, Series X profile, DLSS Balanced + model K, frame generation 2x), each tested in play.

1. Reflections: white "frosted" grain on floors (main fix)

Glossy floors indoors (the house's parquet, kitchen counters) showed a white grain, worse at grazing angles. Reflection settings changed nothing: VICTORY_AMBIENT_SPECULAR at 1 or 0.1, leaving out CS_ResolveScreenSpace, or the old rt_off_hashes list.

Captured frames showed where it comes from (see the diagnostics below):

  • Without the ray-tracing structures, nearly every reflection ray the screen-space march does not resolve reaches sr_tracing:CS_RayMiss (06bb6e728c7c99bf), which gives it the sky's light.
  • Those bright texels among the dark screen-space ones make a grain the title's denoiser cannot smooth. Relative noise on the floor was 0.24 at sr_denoising:CS_SpatialFilter's input and 0.28 at its output.
  • Leaving CS_RayMiss out entirely made interiors clean, but water's reflections then kept earlier frames' bytes.

Change: CS_RayMiss is left out only for opaque and transparent surfaces (first root constant 0 and 1, read as crate::ambient already does). Water's still runs. VICTORY_RAYMISS_KEEP=1 restores the old behaviour. As a side effect, glass (terrariums, sunglasses) and eyes no longer glow white or violet.

2. Frame generation stuck off when the menu asks more than the card does

With F1's 4X on an RTX 40 (2X max), the first switch on was clamped to 2X. Every later switch off (menus, loads) then asked Streamline for 4X with DLSSG_OFF. Streamline refused it: numFramesToGenerate (3) greater than ... numFramesToGenerateMax (1), invalid state. The request was repeated at every present, with 711 errors in one run, and frame generation stayed off. The card's maximum is now applied on and off.

3. VICTORY_NAN_SCRUB=1 ported to this base (off by default)

This comes from 77e13a9 on the earlier base. A NaN or infinity written as a pixel shader colour, or by a float image store, becomes 0. It only enters the shader cache key while on, so existing caches stay valid.

Diagnostics added (diagnostics builds only, all off by default)

These are the tools that found fix 1:

  • F9 (with VICTORY_CAPTURE): captures the next whole frame, as if listed in VICTORY_CAPTURE_FRAMES, including its targets with VICTORY_DUMP_TARGETS.
  • VICTORY_DUMP_RAW=1: each dumped target is also written as raw rows (<name>-pitch<p>.raw, targets up to 1500 texels wide), for the values the PNG normalization hides.
  • VICTORY_DUMP_READS=1: card-written textures that shaders read are dumped too, for inputs written in an earlier frame.
  • translate --warm with VICTORY_SHADER_SAVE=<dir>: the requested containers are written as <hash>.cdxil, for shader-info --disasm.

Notes

  • The release and diagnostics builds compile, and cargo xtask policy passes on every commit.
  • I did not reformat files. cargo fmt --check already reports differences on main in code these commits don't touch.
  • No new unit tests. The changes are env-gated or behaviour verified in game; happy to add tests if you want them.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5533851166 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/428). Originally posted by [PsyloZ](https://github.com/PsyloZ) on 2026-11-27T22:21:23Z. --- Three fixes found while playing on an **RTX 4070 Ti** (Windows 11, 32 GB, Series X profile, DLSS Balanced + model K, frame generation 2x), each tested in play. ## 1. Reflections: white "frosted" grain on floors (main fix) Glossy floors indoors (the house's parquet, kitchen counters) showed a white grain, worse at grazing angles. Reflection settings changed nothing: `VICTORY_AMBIENT_SPECULAR` at 1 or 0.1, leaving out `CS_ResolveScreenSpace`, or the old `rt_off_hashes` list. Captured frames showed where it comes from (see the diagnostics below): - Without the ray-tracing structures, nearly every reflection ray the screen-space march does not resolve reaches `sr_tracing:CS_RayMiss` (`06bb6e728c7c99bf`), which gives it the sky's light. - Those bright texels among the dark screen-space ones make a grain the title's denoiser cannot smooth. Relative noise on the floor was 0.24 at `sr_denoising:CS_SpatialFilter`'s input and 0.28 at its output. - Leaving `CS_RayMiss` out entirely made interiors clean, but water's reflections then kept earlier frames' bytes. **Change:** `CS_RayMiss` is left out only for opaque and transparent surfaces (first root constant 0 and 1, read as `crate::ambient` already does). Water's still runs. `VICTORY_RAYMISS_KEEP=1` restores the old behaviour. As a side effect, glass (terrariums, sunglasses) and eyes no longer glow white or violet. ## 2. Frame generation stuck off when the menu asks more than the card does With F1's 4X on an RTX 40 (2X max), the first switch on was clamped to 2X. Every later switch off (menus, loads) then asked Streamline for 4X with `DLSSG_OFF`. Streamline refused it: `numFramesToGenerate (3) greater than ... numFramesToGenerateMax (1)`, invalid state. The request was repeated at every present, with 711 errors in one run, and frame generation stayed off. The card's maximum is now applied on and off. ## 3. `VICTORY_NAN_SCRUB=1` ported to this base (off by default) This comes from 77e13a9 on the earlier base. A NaN or infinity written as a pixel shader colour, or by a float image store, becomes 0. It only enters the shader cache key while on, so existing caches stay valid. ## Diagnostics added (diagnostics builds only, all off by default) These are the tools that found fix 1: - **F9** (with `VICTORY_CAPTURE`): captures the next whole frame, as if listed in `VICTORY_CAPTURE_FRAMES`, including its targets with `VICTORY_DUMP_TARGETS`. - **`VICTORY_DUMP_RAW=1`**: each dumped target is also written as raw rows (`<name>-pitch<p>.raw`, targets up to 1500 texels wide), for the values the PNG normalization hides. - **`VICTORY_DUMP_READS=1`**: card-written textures that shaders read are dumped too, for inputs written in an earlier frame. - **`translate --warm` with `VICTORY_SHADER_SAVE=<dir>`**: the requested containers are written as `<hash>.cdxil`, for `shader-info --disasm`. ## Notes - The release and diagnostics builds compile, and `cargo xtask policy` passes on every commit. - I did not reformat files. `cargo fmt --check` already reports differences on `main` in code these commits don't touch. - No new unit tests. The changes are env-gated or behaviour verified in game; happy to add tests if you want them.
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
trustno1-coder/VIctory-NVIDIA!428
No description provided.