Mirrors: the mirror's view is given the light around (shows with #1541) #1762
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!1762
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1762"
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?
@KyleS98 on GitHub · 2026-11-28 23:57 UTC · original
KyleS98:pr/mirror-light→main· +488 −0 · 6 files · 2 commits · merged 2026-11-29 08:16 UTCNo issue is open for this (searched the issues and pull requests for: mirror, MirrorReflection, bathroom mirror, StencilCulling, PS_MIRROR_PBR).
What it changes
Mirrors. In the first house's bathroom the round mirror over the sink shows the sky instead of the room. Two things are in the way; this pull request is the second one, and it shows only together with the first (#1541).
How the title draws a mirror
Found with
VICTORY_CAPTUREpass lists,VICTORY_DUMP_TARGETSand the names in the shader containers:MS_VS_MirrorReflectionTransform*,MSNC_VS_MirrorReflectionPedTransformSkinD,PS_MirrorReflectionDeferred*), into a G-buffer of the picture's size rounded up to 16 (1280x736 on Series S), in a centred rectangle the size of the mirror on screen.PS_Prepass_StencilCullingmarks the mirror's pixels by writing that view's depth image through an unordered-access view, in the same command list.ps_generate_material_maskturns the view's G-buffer into a material mask (a D16 image), and one full-screen draw for each kind of material (PS_MIRROR_PBR_MATERIAL_*, depth test EQUAL against the mask) lights the view into an R11G11B10 image.ps_mirror_volumetric_skyandps_mirror_volumetric_scattering_transmittancedraw the sky and the air into that image,ps_mirror_taa_defaultresolves it, andPS_ResolvePortalReflection(drawn with the mirror's own mesh) puts it where the mirror is.The two faults
The change
crates/victory-gpu/src/mirror.rs, hooked inState::prepare_for:ps_generate_material_maskandps_mirror_volumetric_sky. Both run only while a mirror is in the picture.State::replayputs the title's state back.crate::ambient::around, the only addition to that file), or its constant. It has no direction: the view is seen from behind the glass, where the picture's points are not.VICTORY_BVH_BUILDER=1).VICTORY_MIRROR_AMBIENT=<multiple>scales it (default 1);0turns it off.Limits
How it was tested
GPU and profile: RTX 3090 Ti 24 GB (driver 616.92), Ryzen 9 9950X3D, Windows 11 26200. First house from a shared save, bathroom; the save puts the player there in some launches only, and the mirror is in the picture in about half of those, so each result below is from launches repeated until it was. Profiles and settings are named with each result. Ray tracing (the builder) off throughout.
This tree:
d4b5d517+ this + #1541 (cherry-picked; each applies cleanly on top of the other). Series S, DLSS Quality, builder off,play's defaults. The mirror shows the wall opposite with its hook, the blue tile border and the tiles under it, about as dark as the room was in that view (the camera looked away from the window, where the stand-in gives little light). "Times used before the pass" stayed at 0 over the run, which is #1541's doing, and the pass logged its line with the view's rectangle. The frame rate was not measured there: that build's shader cache was still cold.VIctory-Neo (a fork of this tree from
63b902f; the samemirror.rs, with the depth plane published by a change of my own to the same effect as #1541):Speed, in Neo with both changes: the prologue's cell ran 32.9 frames a second where the builds before ran 32.3 and 32.5 (Series X, 2560x1440, frame generation), and 38.8 where they ran 39.0 to 39.5 (Series S, no DLSS): nothing that stands out of the runs' own spread. The pass is one triangle over the mirror's rectangle, and only while a mirror is in the picture.
Not run: this branch without #1541. By the dumps the view's colour is black then, and the pass multiplies by it, so I expect no change at all. Also not run: AMD cards, and the Series X profile on this tree.
cargo test -p victory-gpu --lib mirror::: 3 pass (the parts by name, the setting, both programs of the pass compile).cargo clippy -p victory-gpu --all-targetshas nothing in the new code.For shader changes, the wave sizes tested: no translated shader changes; the pass's own two programs are plain HLSL.
cargo testpassed for the crates it touches: yes (cargo test -p victory-gpuon this branch: 553 passed, 0 failed, 43 ignored).Checked for overlap
draw.rsinState::prepare_for, which #1541 does not change, and each applies cleanly on the other), #1018 (its closed predecessor). Nothing else names mirrors.No screenshots: I don't post pictures of the game.
AI-assisted (Claude Code, Claude Fable 5.2).
@KyleS98 on GitHub · 2026-11-29 00:11 UTC · original
A note on the red check, so it isn't read as this change's: it stops in Clippy on
victory-shader, atemit/lower.rs:13896(unused variablecolour) and:2213(manual checked division), which aremain's own; the run ond4b5d517itself fails on the same two. Nothing in the log is in the files this touches, andcargo clippy -p victory-gpu --all-targetshas nothing in the new code here.AI-assisted (Claude Code, Claude Fable 5.2).
f9dfb76f) into pr/mirror-light d26f197908@KyleS98 on GitHub · 2026-11-29 03:08 UTC · original
Brought up to
main(f9dfb76fmerged in, headd26f1979). One line beyond the merge:mainnow makes a masked twin of a pixel shader (Shader::masked), and that initializer needed the new field, without which the branch no longer compiled againstmainalthough it showed as mergeable. The twin keeps its part in a mirror, being the same program under a sample mask.cargo test -p victory-gpuon the new head: 592 passed, 0 failed, 44 ignored. The in-game runs in the description were ond4b5d517and have not been repeated on the new base. The check still stops in Clippy atmain's own finding invictory-shader(manual checked division,emit/lower.rs), now the only one; nothing in the log is in the files this touches.AI-assisted (Claude Code, Claude Fable 5.2).
@amazedturnip on GitHub · 2026-11-29 05:38 UTC · original
Tested paired with #1541 on 9800X3D + RTX 5070 Ti 16 GB (Series X 1440p DLSS, RT off). Mirror ambient lighting works cleanly across 20+ min gameplay with no artifacts or crashes.