Gathers root's lighting into out and returns out (§68).
constlights = createSceneLights(); // allocated once // per frame, when the render list contains a lit item: collectSceneLights(scene, lights);
The ambient term is read from the root only (see
AmbientLightSource); the directional light is the first one found
in scene-graph order, visibility-filtered; the punctual lights are the first
MAX_PUNCTUAL_LIGHTS found in that same order — see the module header
for the tier, the ordering rule, and the render-list-identical subtree
pruning. A hidden root yields the full no-light state, matching
buildRenderList's empty list for a hidden root.
Positions and directions are read through getWorldPosition /
getWorldDirection, which resolve the light's own ancestor chain on demand
— so the result is correct even before a frame-wide resolve pass, the
guarantee Camera.updateViewMatrix makes. Neither is §43-interpolated
(staged, 2026-08-04): a light animated by the simulation reads its last
resolved transform, one step behind the interpolated geometry at most — the
trade particles.ts records for particle positions, made for the same
reason.
Allocates nothing; every field of out is rewritten in place.
Gathers
root's lighting intooutand returnsout(§68).The ambient term is read from the root only (see AmbientLightSource); the directional light is the first one found in scene-graph order, visibility-filtered; the punctual lights are the first MAX_PUNCTUAL_LIGHTS found in that same order — see the module header for the tier, the ordering rule, and the render-list-identical subtree pruning. A hidden root yields the full no-light state, matching
buildRenderList's empty list for a hidden root.Positions and directions are read through
getWorldPosition/getWorldDirection, which resolve the light's own ancestor chain on demand — so the result is correct even before a frame-wide resolve pass, the guaranteeCamera.updateViewMatrixmakes. Neither is §43-interpolated (staged, 2026-08-04): a light animated by the simulation reads its last resolved transform, one step behind the interpolated geometry at most — the tradeparticles.tsrecords for particle positions, made for the same reason.Allocates nothing; every field of
outis rewritten in place.