Home
API: assemblage

Interface: AssembledPart

lifecycle-kit

lifecycle-kit


lifecycle-kit / assemblage / AssembledPart

Interface: AssembledPart

Defined in: assemblage/assemble.ts:41

A shape placed in depth, ready to draw.

Properties

depth

readonly depth: number

Defined in: assemblage/assemble.ts:44

Larger is nearer. Draw ascending so near parts land on top.


direct

readonly direct: number

Defined in: assemblage/assemble.ts:62

0..1 — the directional term alone, before any part occluded it.

What position against the light says on its own. Kept because it is the honest input to a specular highlight, which cares where the light is and not what is standing in the way.


light

readonly light: number

Defined in: assemblage/assemble.ts:54

0..1 — how much light this part catches, for shading its fill.

Includes shadow cast by the parts in front of it. This is the number a consumer feeds to shade, and it is the one that should be used: the two components are exposed separately below for tests and for a consumer that wants to drive them independently, not because either alone is the right thing to draw with.


occlusion

readonly occlusion: number

Defined in: assemblage/assemble.ts:70

0..1 — how much of this part is covered by the parts in front of it.

Zero for the nearest part in any scene, since nothing is in front of it. A consumer wanting a gradient fill rather than a uniform darkening drives it from this.


shape

readonly shape: Shape

Defined in: assemblage/assemble.ts:42