Home
API: assemblage

Function: assemble()

lifecycle-kit

lifecycle-kit


lifecycle-kit / assemblage / assemble

Function: assemble()

assemble(shapes, light?): readonly AssembledPart[]

Defined in: assemblage/assemble.ts:115

Place each shape in depth, light it, and let the near parts shade the far.

Returned back to front, so a consumer draws in order and the near parts land on top without needing a z-buffer.

Repetitions of the same part are separated by their tag index, which is the reason PartTag carries one. Six legs from a pair rule are not six copies in one plane — the near ones occlude the far ones, and that occlusion is most of what makes a creature look three-dimensional at this scale.

Occlusion is computed after every part has a depth, because a caster has to know it is in front before it can cast. That ordering is the reason this is two passes rather than one map.

Parameters

shapes

readonly Shape[]

light?

Light = DEFAULT_LIGHT

Returns

readonly AssembledPart[]