Renderer · type
SceneCasters
Replay a caster enumeration into the colour pass that is open, materials and all.
Explained in Hello world.
type SceneCasters = ShadowCastersimport type { SceneCasters } from '@driftengine/core';In depth
The counterpart of drawShadowCasters, and the reason ShadowCasterSink carries a material at
all. A consumer enumerates what its frame contains once and hands the same closure to the
shadow cascade, to every cubemap face, and to a mirror or a probe face — rather than re-entering
its own draw path with a second camera, which is what the alternative costs: a consumer
measures the phase it would run twice at 2.3 to 9.4 ms, the largest single row in its frame.
Scatter is declined rather than drawn, and visibly. A scatter batch's colour draw needs the camera and the environment of the frame it is being drawn into, and this enumeration carries neither — it records what a thing is, not what the pass around it looks like. Handing the colour path a stale camera would put the grass of the last pass into this one, which is the silent-plausible-picture failure the two-backends rule exists to forbid. So a replayed pass has no scatter in it, the absence is in the picture rather than in a comment, and a caller wanting grass in a mirror draws it itself with the camera it already has.