Shadow rays without structures are occluded, not lit: no grid of white dots in the shade #3874

Merged
stasadance merged 1 commit from upstream-pr/3874 into main 2026-11-30 14:12:00 +00:00
stasadance commented 2026-11-30 10:02:12 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by stasadance on 2026-11-30T10:02:12Z.


What it changes

With the ray-tracing structure builder off, victory play sets VICTORY_BVH_MISS=1 and every node test misses. CS_RaytraceShadows_Mixed (0873f80dd84a3c5c) traces one ray per block of pixels at a jittered place and writes the ray's entry (bit 15 set: occluded) only when its walk ends on a triangle. A miss leaves the entry as it was, which the title reads as lit. So every shadow ray in the shade came out lit, and the title's filter spread each into a small disc: a regular grid of white dots on walls, skin, clothes and railings in shade.

Now, in programs named CS_RaytraceShadows*, a node test under VICTORY_BVH_MISS or VICTORY_BVH_NO_HIT answers as occluding geometry would: a box enters one child (a triangle one node past the structure's start), and a triangle is hit just short of the ray's end. The program still runs and marks its rays itself, and nothing is read by the node test. Reflection, probe, water and collision rays miss as before, and with the builder on the walk is the title's. VICTORY_SHADOW_RAYS_LIT=1 makes shadow rays miss too, as before (it's part of the shader cache key).

How it was tested

  • GPU and profile: RTX 4090 on Linux (NVIDIA 620.73.04, kron4ek Wine 11.23, vkd3d-proton GE cae8353ed), structure builder off, DLSS + frame generation 2X
  • Before (run 20261130-002520): a regular grid of white dots in shaded areas on a house's balcony at dusk (skin, shirt, wooden rail, walls); the shadow program's source shows the entry is written only on a hit.
  • After (run 20261130-025934, a later build carrying this change): window captures at the same house's deck at dusk and its doorway show no dot grid in shade on any of the frames checked (3 of 9 captures inspected).
  • For shader changes, the wave sizes tested: the wave size the run used; not tested separately at 32 and 64.
  • cargo test passed for the crates it touches: cargo test -p victory-shader --lib on a Linux host, 295 passed (the new shadow_ray_programs_are_told_by_name is in the Windows-only emit tests); cargo xwin clippy for the Windows target adds no warning over current main.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #1470 (a shader cache key for ray tracing).
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5563056255 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3874). Originally posted by [stasadance](https://github.com/stasadance) on 2026-11-30T10:02:12Z. --- ## What it changes With the ray-tracing structure builder off, `victory play` sets `VICTORY_BVH_MISS=1` and every node test misses. `CS_RaytraceShadows_Mixed` (`0873f80dd84a3c5c`) traces one ray per block of pixels at a jittered place and writes the ray's entry (bit 15 set: occluded) only when its walk ends on a triangle. A miss leaves the entry as it was, which the title reads as lit. So every shadow ray in the shade came out lit, and the title's filter spread each into a small disc: a regular grid of white dots on walls, skin, clothes and railings in shade. Now, in programs named `CS_RaytraceShadows*`, a node test under `VICTORY_BVH_MISS` or `VICTORY_BVH_NO_HIT` answers as occluding geometry would: a box enters one child (a triangle one node past the structure's start), and a triangle is hit just short of the ray's end. The program still runs and marks its rays itself, and nothing is read by the node test. Reflection, probe, water and collision rays miss as before, and with the builder on the walk is the title's. `VICTORY_SHADOW_RAYS_LIT=1` makes shadow rays miss too, as before (it's part of the shader cache key). ## How it was tested - GPU and profile: RTX 4090 on Linux (NVIDIA 620.73.04, kron4ek Wine 11.23, vkd3d-proton GE cae8353ed), structure builder off, DLSS + frame generation 2X - Before (run 20261130-002520): a regular grid of white dots in shaded areas on a house's balcony at dusk (skin, shirt, wooden rail, walls); the shadow program's source shows the entry is written only on a hit. - After (run 20261130-025934, a later build carrying this change): window captures at the same house's deck at dusk and its doorway show no dot grid in shade on any of the frames checked (3 of 9 captures inspected). - For shader changes, the wave sizes tested: the wave size the run used; not tested separately at 32 and 64. - `cargo test` passed for the crates it touches: `cargo test -p victory-shader --lib` on a Linux host, 295 passed (the new `shadow_ray_programs_are_told_by_name` is in the Windows-only emit tests); `cargo xwin clippy` for the Windows target adds no warning over current main. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #1470 (a shader cache key for ray tracing).
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!3874
No description provided.