NVIDIA: rays miss unbuilt structures (purple plants) + NaN scrub #82

Merged
vvzxcvv merged 2 commits from upstream-pr/82 into main 2026-11-28 19:01:28 +00:00
vvzxcvv commented 2026-11-27 17:22:55 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by vvzxcvv on 2026-11-27T17:22:55Z.


Problem

On NVIDIA, vegetation outdoors renders purple, magenta or violet instead of green, identically every run in the same spot. Separately, NaN or infinity values written by shaders can spread into black blobs (faces, sky) or white flashes through bloom, blur and the temporal upscaler.

1. Rays miss every node while the structure builder is off (VICTORY_BVH_MISS)

With the title's structure builder off (its wave64 programs don't run on NVIDIA), the ray-tracing structures are never built, but the node test in emit/intersect.rs still walked whatever lay in their memory. The screen-probe traces turned those false hits into violet and magenta light (the leftovers 826ba15 partly filters), which shows most on vegetation. With the switch on, every node test is a miss without reading the node, so each walk ends at its first node. It stays off while VICTORY_BVH_BUILDER=1.

This is a stopgap until the structure builder runs on NVIDIA; it switches itself off when VICTORY_BVH_BUILDER=1.

2. NaN scrub (VICTORY_NAN_SCRUB)

Pixel-shader colour exports and float image stores become 0 where |x| >= inf (NaN included), so one bad value can't spread through the title's blur and temporal passes.

Both are part of the shader cache key and on in the play settings. Both are ported from rorodev6's victory-nvidia-megafork.

Tested

RTX 4070 Ti SUPER (610.88), Ryzen 7 7800X3D, 32 GB, Windows 10 22H2 (Agility SDK 1.620), release build, Series S, DLSS Quality:

  • Vegetation: green again (was purple and magenta); the megafork renders the same spot green.
  • Frame rate: unchanged (18.0 versus 18.2 fps average in the open world).
  • Trade-off: light bounced off nearby surfaces is lost, so some dim rooms may be slightly darker.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5530596745 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/82). Originally posted by [vvzxcvv](https://github.com/vvzxcvv) on 2026-11-27T17:22:55Z. --- Problem On NVIDIA, vegetation outdoors renders purple, magenta or violet instead of green, identically every run in the same spot. Separately, NaN or infinity values written by shaders can spread into black blobs (faces, sky) or white flashes through bloom, blur and the temporal upscaler. ### 1. Rays miss every node while the structure builder is off (VICTORY_BVH_MISS) With the title's structure builder off (its wave64 programs don't run on NVIDIA), the ray-tracing structures are never built, but the node test in emit/intersect.rs still walked whatever lay in their memory. The screen-probe traces turned those false hits into violet and magenta light (the leftovers 826ba15 partly filters), which shows most on vegetation. With the switch on, every node test is a miss without reading the node, so each walk ends at its first node. It stays off while VICTORY_BVH_BUILDER=1. This is a stopgap until the structure builder runs on NVIDIA; it switches itself off when VICTORY_BVH_BUILDER=1. ### 2. NaN scrub (VICTORY_NAN_SCRUB) Pixel-shader colour exports and float image stores become 0 where |x| >= inf (NaN included), so one bad value can't spread through the title's blur and temporal passes. Both are part of the shader cache key and on in the play settings. Both are ported from rorodev6's victory-nvidia-megafork. Tested RTX 4070 Ti SUPER (610.88), Ryzen 7 7800X3D, 32 GB, Windows 10 22H2 (Agility SDK 1.620), release build, Series S, DLSS Quality: - Vegetation: green again (was purple and magenta); the megafork renders the same spot green. - Frame rate: unchanged (18.0 versus 18.2 fps average in the open world). - Trade-off: light bounced off nearby surfaces is lost, so some dim rooms may be slightly darker.
eleboucher commented 2026-11-28 10:19:12 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by eleboucher on 2026-11-28T10:19:12Z.


Two problems I found testing this on an RTX 4070 Ti SUPER (Windows 11, ray tracing on with VICTORY_RT_NATIVE=1):

  1. bvh_miss() only turns itself off for VICTORY_BVH_BUILDER=1, but builder_asked() in pipeline/make.rs treats VICTORY_RT_NATIVE=1 as the builder running too. With RT_NATIVE and VICTORY_BVH_MISS=1 every ray missed (violet eyes in a close-up; brown irises after the fix).
  2. The shader cache hashed the raw VICTORY_BVH_MISS value, so a run with the builder on could be served always-miss translations cached by a run without it. The key should be the effective bvh_miss() result.

The fix is one commit on top of this PR's head: github.com/eleboucher/VIctory-NVIDIA@fb765c7c (branch up-bvh-miss-fix on eleboucher/VIctory-NVIDIA). It makes bvh_miss() public, also checks VICTORY_RT_NATIVE, and pushes its result into the cache key instead of the env var. Windows type-check and cargo test -p victory-shader --lib pass on it.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7237818464 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/82#issuecomment-7237818464). Originally posted by [eleboucher](https://github.com/eleboucher) on 2026-11-28T10:19:12Z. --- Two problems I found testing this on an RTX 4070 Ti SUPER (Windows 11, ray tracing on with VICTORY_RT_NATIVE=1): 1. `bvh_miss()` only turns itself off for VICTORY_BVH_BUILDER=1, but `builder_asked()` in pipeline/make.rs treats VICTORY_RT_NATIVE=1 as the builder running too. With RT_NATIVE and VICTORY_BVH_MISS=1 every ray missed (violet eyes in a close-up; brown irises after the fix). 2. The shader cache hashed the raw VICTORY_BVH_MISS value, so a run with the builder on could be served always-miss translations cached by a run without it. The key should be the effective `bvh_miss()` result. The fix is one commit on top of this PR's head: https://github.com/eleboucher/VIctory-NVIDIA/commit/fb765c7c (branch `up-bvh-miss-fix` on eleboucher/VIctory-NVIDIA). It makes `bvh_miss()` public, also checks VICTORY_RT_NATIVE, and pushes its result into the cache key instead of the env var. Windows type-check and `cargo test -p victory-shader --lib` pass on it.
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!82
No description provided.