#1440: Alpha-blended layers lying on a surface take its shadowed lamp light #1442
No reviewers
Labels
No labels
amd
avatars
bug
builder
cannot-reproduce
crash
epic
feature
from-viewer
gl-removal
known-limitation
monitoring
parity
perf
platform
priority
critical
priority
high
priority
low
priority
medium
provenance
rendering
rt
status
in-progress
status
testing
status
up-next
triage
ui
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
sky_line/Slipstream!1442
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "TheSlowly/Slipstream:blend-lamp-shadows"
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?
Fixes #1440. Four commits on top of PR #1420 (its first commit is #1419). The lighting records each pixel's demodulated shadowed lamp light (8 B per render pixel with RenderVKDeferVisReuse); a blended layer that matches the surface under it skips the lamps the deferred walk owns and adds the record with its own colours. Plus: the rigged alpha-blend FS gets the visibility reuse (CLEAN_RIG_ALPHA), a blend caster within 5 mm of its receiver casts nothing on it, and the record is written on nothing-casts frames. Every shader variant and the C++ pass the checks; the in-world test from the Test-Plans is still pending.
With "Shadows from all lights" (RenderVKReSTIRDI) in radiance mode (RenderVKReSTIRRadiance), pass 15's denoised image holds the shadowed light of every light it owns: the ray-traced projector records, ReSTIR's point lights and projectors inside the light grid, and the emitters. The deferred light walk leaves those lights out and BASE / COMBINE add the image once per pixel. Alpha-blended surfaces are shaded forward in pass 2, and their light walk had no such hooks, so it lit every lamp unshadowed. A blush or makeup layer on a mesh head, or a decal on a wall, glowed in a lamp's light (a wood stove's fire, a ceiling light) where the skin or wall under it lay in that lamp's shadow. BASE / COMBINE now record, per pixel, the demodulated diffuse and specular radiance they lit the surface with (RG32UI, two RGB9E5 words; set 3 binding 29, draw set 0 binding 65; 8 B per render pixel while RenderVKDeferVisReuse is on, its description updated). They write it on every frame the visibility reuse's depth record is written, including the frames where nothing casts. A blended fragment that matches the surface under it (the existing strict match: depth within 4 mm + 0.1 %, normal within ~25 degrees) on a frame whose push word says the record is current (VISR_RAD) skips exactly the lights the deferred walk skips. Its hooks are the deferred kernels' rules evaluated in the forward FS: the same light set test, the same light grid test (draw set 0 binding 66, the deferred set's buffer), the same light-takeover test. It then adds the record, remodulated by its own diffuse and specular colours through the same call site the deferred kernels use, so the layer gets the surface's lamp light with its shadows and emitters. The rigged flavour takes it too. Fragments that match nothing walk every light as before, and so does everything on frames in ratio mode or with the reuse off. Test-Plan: python3 indra/newview/tests/blend_lamp_reuse_checks.py --source-root . --compile --out <dir> (the push bit, the record's bindings on both sides, the forward hooks against the deferred rules, the write in BASE / COMBINE; every lit FS variant and the lighting kernel's passes through glslc) python3 indra/newview/tests/blend_opaque_gbuffer_checks.py --source-root . python3 indra/vkclean/regen_world_spv.py --out-dir <dir> --cache-dir <dir> In world (deferred, RenderVKReSTIRDI 1-3, RenderVKReSTIRRadiance on): in a room lit by a point light (a fireplace, a lamp), a blush or makeup layer on a mesh head is shadowed exactly where the skin is, also with sun shadows off at night; a decal on a wall takes the wall's lamp shadow. RenderVKDeferVisReuse 0 or RenderVKReSTIRRadiance 0 brings the unshadowed glow back live. Glass and hair away from surfaces: lit as before. Log: "VKDeferSplit: intermediates ..." lists "visibility reuse depth + lamp record". VKPipeStats: LIT_ALPHA / LIT_RIG_ALPHA registers close to before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>1e84f38d82to281d1d42dd281d1d42ddtocc38a97debView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.