Skip to content

LightEffectBuildContext

Defined in: packages/three-flatland/src/lights/LightEffect.ts:41

Compile-time context — passed to buildLightFn (called once on attach).

S extends EffectSchema = EffectSchema

constants: EffectConstants<S>

Defined in: packages/three-flatland/src/lights/LightEffect.ts:45

Read-only constants from factory function fields.


lightStore: LightStore

Defined in: packages/three-flatland/src/lights/LightEffect.ts:47

The LightStore providing light data textures and count.


sdfTexture: Texture <unknown> | null

Defined in: packages/three-flatland/src/lights/LightEffect.ts:61

Stable reference to the scene’s SDF texture. Non-null only when the effect’s class declared needsShadows = true — in that case Flatland eagerly allocates the SDFGenerator before calling buildLightFn so the reference is bindable in TSL texture() calls. The texture’s RTs are 1×1 placeholders at build time; the shadow pipeline system resizes them on first frame and refreshes contents each subsequent frame, without ever changing the reference.

Null when the active effect doesn’t declare needsShadows — shaders should compile out the shadow path in that case (JS-level if, not a GPU branch).


uniforms: { [K in string | number | symbol]: SchemaToNodeType<S[K]> }

Defined in: packages/three-flatland/src/lights/LightEffect.ts:43

TSL uniform nodes for each uniform schema field, keyed by field name.


worldOffsetNode: UniformNode <"vec2", Vector2 >

Defined in: packages/three-flatland/src/lights/LightEffect.ts:72

Camera frustum bottom-left offset uniform node, updated each frame.


worldSizeNode: UniformNode <"vec2", Vector2 >

Defined in: packages/three-flatland/src/lights/LightEffect.ts:68

Camera frustum width/height uniform node, updated each frame from the camera bounds. Effects that map between world and UV space (shadow sampling, radiance cascades, any other screen-projected sampler) consume this instead of rolling their own uniform.