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

Open
github-bot wants to merge 3 commits from github-bot/gh-428 into main AGit
Owner

@⁠PsyloZ on GitHub · 2026-11-27 22:21 UTC · original
PsyloZ:fix/reflection-frost-nvidia → main · +141 −19 · 6 files · 3 commits · open

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.
**@⁠PsyloZ** on GitHub · 2026-11-27 22:21 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/428) `PsyloZ:fix/reflection-frost-nvidia` → `main` · +141 −19 · 6 files · 3 commits · open 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.
With the F1 menu's 4X on an RTX 40 (2X at most), the first switch on was
clamped to 2X, but every later switch off (a menu, a load) asked Streamline
for 4X with DLSSG_OFF. Streamline refuses that ("numFramesToGenerate (3)
greater than DLSS-G supported numFramesToGenerateMax (1)", invalid state),
the switch never took, and it was asked again at every present: 711 errors
in one run and frame generation stuck off. The card's maximum is now asked
whenever more than 2X is wanted, on or off.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
From this fork's earlier base (77e13a9): a NaN or an infinity that a pixel
shader writes as a colour, or a float image store writes, becomes 0, so it
cannot spread through bloom, blur or the upscaler's history into black
patches. Not what the console does, so it stays a switch. It goes into the
shader cache's key only while it is on, so caches made without it are still
served.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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. On floors seen at a
grazing angle, those bright texels among the dark screen-space ones make a
white grain the title's denoiser cannot smooth (RTX 4070 Ti, Series X,
DLSS: the house's parquet looked frosted, more so at grazing angles).
Captured frames showed the grain already in the spatial filter's input and
output (relative noise 0.24 in, 0.28 out), and leaving the program out made
the interiors clean but water's reflections kept earlier frames' bytes.

So the miss program is now left out only for opaque and transparent
surfaces (its first root constant, 0 and 1, as crate::ambient already
reads it); water's still runs. VICTORY_RAYMISS_KEEP=1 runs it everywhere,
as before. With it left out, VICTORY_AMBIENT_SPECULAR(_ALPHA) no longer
apply to those surfaces.

Diagnostics used to find it (diagnostics builds only, all off by default):
- F9 (with VICTORY_CAPTURE): the next whole frame is captured as if listed
  in VICTORY_CAPTURE_FRAMES, with its targets under VICTORY_DUMP_TARGETS.
- VICTORY_DUMP_RAW=1: each dumped target also as raw rows
  (<name>-pitch<p>.raw, targets up to 1500 texels wide), for the values the
  PNG's normalization hides.
- VICTORY_DUMP_READS=1: textures the card writes that shaders read are
  dumped too (an input written in an earlier frame).
- translate --warm with VICTORY_SHADER_SAVE=<dir>: the containers asked for
  are written as <hash>.cdxil, for shader-info --disasm and translate --list.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 22:26:21 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

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