Skip to content

Reflections: the miss program's sky is left out only while the structure builder is off (black metal and glass with RAY TRACING on) - #3058

Closed
nick0451 wants to merge 1 commit into
trustno1-coder:mainfrom
nick0451:fix/raymiss-with-builder
Closed

nick0451 wants to merge 1 commit into
trustno1-coder:mainfrom
nick0451:fix/raymiss-with-builder

Conversation

@nick0451

Copy link
Copy Markdown

What happens

With RAY TRACING on (VICTORY_BVH_BUILDER=1), reflections whose rays really find nothing come out black instead of taking the sky. On the house balcony the aluminium ladder, white with ray tracing off, turns black, and the glass door's panes go black too.

Why

#428 left out CS_RayMiss for opaque and transparent surfaces (DrawCtx::sky_miss_left_out). Without the ray-tracing structures nearly every ray reaches it and took the sky's light (white grain on floors), so leaving it out was right with the builder off. The check never asks whether the builder runs, though. Every other ray-tracing skip does: pipeline::make's left_out, the builder dispatches in draw.rs, and ambient. With the builder on, rays that reach the miss program have really found nothing and should take the sky. They got nothing.

The change

sky_miss_left_out also requires !crate::pipeline::builder_runs(). With the builder off nothing changes. With it on, the miss program runs as the title intends. (While the builder rests for its two frames, builder_runs() is false and the program stays out, as before.)

This is complementary to #2764 / #2872, which clear the left-out program's output: with the builder on, it isn't left out any more.

Tested

RTX 3090 24 GB, Windows 11, main 829188e9 (+ the 2-line start fix of #2392 to get past the commit-gate regression on this PC), Series S, DLSS performance, a frozen balcony save, RAY TRACING on. Shaders were compiled by earlier runs (the first run with the builder crawls at ~0.1 fps while the RT shader set compiles and static structures are rehydrated).

aluminium ladder glass door panes
ray tracing off white blinds, dark glass
ray tracing on, main black black
ray tracing on, this change white again (stickers visible) reflect the sky
  • No device removal or crash in any RT run on this card (balcony and a city street).
  • Speed: on the city street, RT on gave 15.7 fps on main and 12.1 with this change (one round each). The miss program runs again, so some cost is expected. One round is noisy, so treat that as rough.
  • With the builder off, the behaviour is unchanged by construction (the old condition plus one more &&).

Not this change: in some captures with RT on, the near railing's top turns black for a while, on main too. I'm looking into that separately.

🤖 Generated with Claude Code

…ure builder is off

trustno1-coder#428 left out CS_RayMiss for opaque and transparent surfaces, because without the
ray-tracing structures nearly every ray reaches it and took the sky's light (white grain
on floors). The check did not ask whether the builder runs, as every other ray-tracing
skip does (pipeline::make's left_out, draw's builder dispatches, ambient): with RAY
TRACING on (VICTORY_BVH_BUILDER=1) rays that really found nothing still went without
the sky. Now it is left out only while pipeline::builder_runs() is false.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nick0451

Copy link
Copy Markdown
Author

Note on the failing check job: it stops at victory-loader (function unwind_copy is never used), a crate this PR doesn't touch. Main fails the same way (cargo clippy -p victory-loader --all-targets -- -D warnings), so it isn't from this change. Same as #2746.

🤖 Generated with Claude Code

@dyshay

dyshay commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

Merged into our fork's integration branch for testing (dyshay/VIctory-NVIDIA, branch janus-prs). I read the full diff first: no network access, process spawning, binaries, build or dependency changes, or game data. It builds with --profile diag --features diagnostics, and the CPU tests of the touched crates pass. A run on an RTX 4090 is queued (Series S with ray tracing, DLSS Quality). Frame times will follow here.

@nick0451

Copy link
Copy Markdown
Author

Correction to the evidence above: the ladder before/after was run-to-run variation, not this change. I ran it properly: 4 fresh RT starts each, alternating, same save, same settings (RTX 3090, RAY TRACING on, shaders already compiled).

aluminium ladder black other black areas in the frame fps (runs)
main 0 of 4 1 of 4 (near railing top) 16.4 (17.7, 11.8, 16.4; 1 run left out)
this change 1 of 4 2 of 4 (a whole character dark; a black patch on the wall and door) 13.9 (13.2, 17.4, 14.5, 9.7)

So the black ladder/railing/patches are an intermittent ray-tracing problem in both builds, varying from start to start (plausibly the overlapping dynamic structures of #1412; cf. #2109's "about 1 run in 3 clean"). This PR doesn't fix them, and my single-run comparison overstated it. Sorry for the noise, and to anyone who picked it up on that basis.

What remains true: with the builder on, sky_miss_left_out still drops CS_RayMiss, unlike every other ray-tracing skip, so rays that really miss get no sky. That's a consistency fix, but I can't show a visible benefit on this save, and the miss program costs frame time again (the fps above lean that way, though they're noisy). Reasonable to hold it until the intermittent corruption is understood. I'm happy to convert this to a draft or close it, whichever you prefer.

🤖 Generated with Claude Code

@nick0451

Copy link
Copy Markdown
Author

Closing for now, per the correction above: the visible difference I reported was run-to-run variation, and the change's benefit isn't demonstrated. I'll come back with N-run evidence once the intermittent ray-tracing corruption (#1412-type) is understood, if it still matters then.

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants