The depth-only caster module โ gl-shadow.ts's two stages, ported.
The vertex stage transforms through model then viewProjection in the
exact association shadedVertexStageWgsl uses, with the same ยง3.3.8 depth
remap on the way out โ a caster and its own on-screen draw then agree with
the receiver's shadowMatrix * world arithmetic, which is one fewer source
of disagreement between the depth a receiver computes and the depth the map
holds. draw.viewProjection carries the light's matrix
(SceneLights.shadowMatrix); the block is the ordinary strided
DrawUniforms, so the caster pass needs no layout of its own.
The fragment stage writes constant opaque white for gl-shadow.ts's
reason, one shade stronger here: WebGPU requires a fragment output for
every colour attachment the pass carries, and the shadow target's cache row
(R1.6) always allocates one โ so the constant is both the defined-behaviour
answer and a debug view of the map that shows a silhouette. draw.color is
never read; the renderer packs the canonical zero block, like a mask's.
The depth-only caster module โ
gl-shadow.ts's two stages, ported.The vertex stage transforms through
modelthenviewProjectionin the exact associationshadedVertexStageWgsluses, with the same ยง3.3.8 depth remap on the way out โ a caster and its own on-screen draw then agree with the receiver'sshadowMatrix * worldarithmetic, which is one fewer source of disagreement between the depth a receiver computes and the depth the map holds.draw.viewProjectioncarries the light's matrix (SceneLights.shadowMatrix); the block is the ordinary stridedDrawUniforms, so the caster pass needs no layout of its own.The fragment stage writes constant opaque white for
gl-shadow.ts's reason, one shade stronger here: WebGPU requires a fragment output for every colour attachment the pass carries, and the shadow target's cache row (R1.6) always allocates one โ so the constant is both the defined-behaviour answer and a debug view of the map that shows a silhouette.draw.coloris never read; the renderer packs the canonical zero block, like a mask's.