Alpha-blended layers lying on a surface take its shadowed lamp light (ReSTIR radiance mode) #1440

Open
opened 2026-11-04 08:36:20 +00:00 by TheSlowly · 0 comments
Collaborator

With "Shadows from all lights" (RenderVKReSTIRDI 1-3) in radiance mode (RenderVKReSTIRRadiance, default on), solid surfaces get every point light, projector and emitter shadowed by pass 15's ray-traced estimate. Alpha-blended surfaces are forward-shaded in pass 2 and their light walk had no such hooks, so they lit every lamp unshadowed: a blush or makeup layer on a mesh head, a decal on a wall, glowed in a lamp's light where the skin or wall under it lay in that lamp's shadow.

The lighting's BASE / COMBINE now record per pixel the demodulated lamp light they lit the surface with (RG32UI, 8 B per render pixel while RenderVKDeferVisReuse is on). A blended fragment that matches the surface under it (the existing strict visibility-reuse match) skips exactly the lights the deferred walk skips and adds the record with its own colours, so it gets the surface's lamp light, shadows and emitters included. Supporting changes: the rigged alpha-blend pipeline gets its own FS flavour so avatar layers match the skin; a blend caster within 5 mm of its receiver casts no shadow on it; the record is written on nothing-casts frames too.

Not covered (a follow-up): free-floating blended surfaces (glass, loose hair, particles) still take unshadowed lamp light.

Needs the in-world test from the commits' Test-Plan before merging.

With "Shadows from all lights" (`RenderVKReSTIRDI` 1-3) in radiance mode (`RenderVKReSTIRRadiance`, default on), solid surfaces get every point light, projector and emitter shadowed by pass 15's ray-traced estimate. Alpha-blended surfaces are forward-shaded in pass 2 and their light walk had no such hooks, so they lit every lamp unshadowed: a blush or makeup layer on a mesh head, a decal on a wall, glowed in a lamp's light where the skin or wall under it lay in that lamp's shadow. The lighting's BASE / COMBINE now record per pixel the demodulated lamp light they lit the surface with (RG32UI, 8 B per render pixel while `RenderVKDeferVisReuse` is on). A blended fragment that matches the surface under it (the existing strict visibility-reuse match) skips exactly the lights the deferred walk skips and adds the record with its own colours, so it gets the surface's lamp light, shadows and emitters included. Supporting changes: the rigged alpha-blend pipeline gets its own FS flavour so avatar layers match the skin; a blend caster within 5 mm of its receiver casts no shadow on it; the record is written on nothing-casts frames too. Not covered (a follow-up): free-floating blended surfaces (glass, loose hair, particles) still take unshadowed lamp light. Needs the in-world test from the commits' Test-Plan before merging.
TheSlowly added this to the Slipstream project 2026-11-04 08:36:20 +00:00
Sign in to join this conversation.
No milestone
No project
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
sky_line/Slipstream#1440
No description provided.