Shaders: limit highlights on small dust sprites (opt-in VICTORY_PARTICLE_KNEE, port of VIctory-NVIDIA #2156) #444
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/444"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from TaynanGT/Vice-Tay. Originally posted by notdxbi on 2026-11-29T14:08:02Z.
Brings Yoshi-233's fix for the bright indoor specks (trustno1-coder/VIctory-NVIDIA#695) to Vice-Tay. Their pull request trustno1-coder/VIctory-NVIDIA#2156 is still open there. Authorship is kept (
--authorYoshi-233,cherry picked from 8cd858b0). This PR adds a Vice-Tay measurement on Linux.What it changes
Without ray tracing, one dual-source dust particle pixel shader puts single bright pixels over dark interiors. They look like white "fireflies" on ceilings, walls and cabinets, worst in Jason's house. With
VICTORY_PARTICLE_KNEE=<knee>set, the translation of that one program estimates each sprite's screen area from barycentric derivatives. It then puts a soft shoulder on the brightest emission of very small sprites, and restores the matching transmission. The knee is part of the shader cache key. When the variable is unset, the translation is unchanged, so this is opt-in.One adaptation for Vice-Tay:
lower_with_particlespassesLower::newtheearly_depthargument that Vice-Tay has and VIctory-NVIDIA does not. Nothing else differs from 8cd858b0.Measurement
Setup. RTX 5060 8 GB (PCIe 3.0 x8), driver 620.70.06; Ryzen 7 5700X; 32 GB. Nobara Linux 44, kernel 7.3.4, GE-Proton11-14-viewtree, outside Steam. Build:
mainfe7c6e52+ this commit (f123694a),cargo build --locked --profile diag -p victory --features diagnostics, x86_64-pc-windows-gnu. Settings: linux/play.sh's NVIDIA set, play.ps1-Machine 4070threads, the #384 8 GB memory values (CARD_BUFFERS_MB=1024,CARD_WINDOWS_MB=512,TEXTURE_ROOM_PERCENT=85),PIPELINE_WAIT_MS=0, BCPack tables (#385), and DLSS Quality. Series S, 1080p output shown at 2560×1440.Same exe both runs. The 44 launch settings are identical except
VICTORY_PARTICLE_KNEE=0.012in B (A settings, B settings). The scene is the Chapter 1 save ("Gone Fishing"), inside Jason's house, facing the kitchen ceiling, wall and cabinets, hands off the controls. Each recording started only after the pipeline queue was empty (≤ 20 being made), so no draws were missing from a pipeline still being built. Each run has 60 s of video plus 20 lossless 2560×1440 screenshots, all reviewed.Speck counter (
specks.py). A speck is an 8-connected blob of ≤ 25 px whose luminance is ≥ 25 sRGB levels above the median of its 9×9 neighbourhood. It is counted only on dark (median ≤ 60) and smooth (local median range ≤ 12, so object edges are left out) surfaces, outside the overlay and the money HUD.specks_mark.pyrings every counted blob.In B, the ceiling box has no specks in any frame. The blobs B still counts on the whole frame are object edges the smoothness test doesn't fully catch: leaves through a window, door glass, the edge of the glass case. They are visible in B marked. So the −84% on the full frame is a lower bound for the improvement. The fps is the same in both runs. The low absolute fps (GPU ~280–300 ms a frame) is this 8 GB card on stock
mainwith VRAM full and spilling, and it is the same in both runs.Full frames with every counted blob ringed: A · B. One frame every 5 s of each video: A · B. Videos: A · B. Per-frame counts: counts/.
Review of both videos, start to finish. Neither has flicker, HUD damage, colour shifts or other new artifacts. In B the ceiling, walls and cabinets stay free of specks for the whole 60 s. In A they are visible in every sampled frame, and a few drift between frames.
Limits of the comparison.
Checks
cargo test --locked -p victory-shader: 227 passed, 0 failed, 2 ignored.cargo clippy --locked -p victory-shader -p victory-gpu --all-targets --target x86_64-pc-windows-gnu -- -D warnings: clean.With #439
This commit conflicts with the draft integration #439 in
lower.rsonly. Both add a function at the same place, and the fix is to keep both. Branchparticle-knee-on-439is this commit on #439's head (cfd5ebda):victory-shadertests 232 passed. Its Clippy errors are #439's own, the ones #442 fixes.AI use: Claude Code (Claude Opus 5.5) ported, built, ran the counter and wrote this. The runs were played by hand. Credit for the fix: Yoshi-233.
🤖 Generated with Claude Code
Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-29T14:39:02Z.
I integrated the particle shoulder locally as
761cdb088, retaining the existing geometry lowering and early-depth path, with credit to Yoshi-233 and notdxbi. It remains opt-in. The shader suite is running; the reported speck reduction is promising, but I still need a matched 4K visual comparison before treating it as validated.Imported from TaynanGT/Vice-Tay. Originally posted by Kal0s-design on 2026-11-29T14:47:11Z.
Review: COMMENTED
Checked this on Windows (
f123694), without running the title.cargo test -p victory-shader --lib: 343 passed.cargo clippy --workspace --all-targets -D warnings, with and without--all-features: clean.cargo xtask policy: ok.shaders.rpfplus the exe and DLLs) into two empty caches, once withVICTORY_PARTICLE_KNEEunset and once with0.012. Both runs give 25,788 shaders, 197 that don't translate (the same two reasons) and 0 not cached, so the knee breaks nothing else.From reading the change: unset,
lower_containergoes straight tolower(parts), the same path as before. A NaN peak givesmax(peak, knee) = knee, so the scale is 1. A degenerate footprint (zero derivatives) gives weight 0, so nothing changes there either.SDivon float operands is LLVM'sfdivin bitcode, as elsewhere inlower.rs.One small thing: nothing exercises the knee path in the test suite. The scan above only shows it translates. A test that lowers a small dual-source PS with the knee set and checks the extra
fmulon color 0 would keep it from breaking silently. The digest can't match a synthetic program, though, so it would need a way to force the path.AI-assisted: yes
Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-29T19:03:58Z.
Thanks for the native Windows checks and the full shader-cache comparison. The single changed translation is good evidence of the intended scope, not yet of visual correctness. I agree with adding a synthetic dual-source pixel shader test through an internal test-only selector: check the enabled and disabled paths, color 0 scaling, and preservation of the second output. Keep the public digest restriction intact.
Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-30T17:06:31Z.
mainhas moved to a new line of the code and everything is now named Vice-Tay, so this PR no longer applies as it is (details in #468). If you'd like this change in, please rebuild it on the currentmainand open a new PR; I'll review it there.Pull request closed