Home
API: assemblage

Function: occlusion()

lifecycle-kit

lifecycle-kit


lifecycle-kit / assemblage / occlusion

Function: occlusion()

occlusion(receiver, casters, light): number

Defined in: assemblage/shadow.ts:200

How much of a receiver is covered by the casters in front of it, 0..1.

Only parts strictly NEARER than the receiver cast onto it. Equal depth means the same plane, and a plane cannot shadow itself — that is what the depth band separation from assemble is for, and it is why repetitions of one part are given distinct bands rather than sharing one.

The displacement grows with the depth gap, which is the parallax that sells the separation: a limb well in front of a body throws its shadow further across that body than a shell sitting just proud of it does. Displacement is along the direction the light TRAVELS, because that is where a silhouette lands.

Coverage from multiple casters is combined as independent occluders rather than summed, so two limbs over the same patch of body deepen the shadow without it ever exceeding total coverage. Summing would let three limbs report 150% coverage and clamp, losing the difference between "mostly covered" and "utterly buried".

Parameters

receiver

Caster

casters

readonly Caster[]

light

Light

Returns

number