Skip to content

wrapWithLightFlags

wrapWithLightFlags(lightFn): ColorTransformFn

Defined in: packages/three-flatland/src/lights/wrapWithLightFlags.ts:21

Wrap a light ColorTransformFn with a per-instance lit-bit gate.

Uses readLitFlag + select() to bypass lighting for sprites whose lit flag is not set. Only needed for batched sprites — standalone usage can assign the raw lightFn directly.

This is the only light-specific helper in the per-instance-accessor family; the raw accessors (readFlip, readShadowRadius, etc.) live in materials/instanceAttributes.ts alongside the flag-mask constants that define the bit layout. They’re re-exported from this module’s barrel for convenience and backward compatibility.

ColorTransformFn

The lighting ColorTransformFn to wrap

ColorTransformFn

A new ColorTransformFn that gates lighting per instance