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

Manually merged
github merged 1 commit from github-bot/gh-3874 into gh-pr/3874/base 2026-11-30 14:14:51 +00:00 AGit
Owner

@⁠stasadance on GitHub · 2026-11-30 10:02 UTC · original
stasadance:fix/shadow-rays-no-structure → main · +90 −2 · 4 files · 1 commits · merged 2026-11-30 14:12 UTC

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).
**@⁠stasadance** on GitHub · 2026-11-30 10:02 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3874) `stasadance:fix/shadow-rays-no-structure` → `main` · +90 −2 · 4 files · 1 commits · merged 2026-11-30 14:12 UTC ## 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).
With the 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
(run v10v, the balcony at dusk).

Now, in programs named CS_RaytraceShadows*, a node test with 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; nothing is read by the node test. Reflection, probe, water and
collision rays miss as before; with the builder on the walk is the title's.
VICTORY_SHADOW_RAYS_LIT=1: shadow rays miss too, as before (keyed in the
shader cache).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 10:02:39 +00:00
github-bot changed target branch from main to gh-pr/3874/base 2026-11-30 14:14:34 +00:00
github manually merged commit 8e53c2c512 into gh-pr/3874/base 2026-11-30 14:14:35 +00:00
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!3874
No description provided.