Skip to content

LightingComposite

Defined in: lighting/src/LightingComposite.ts:54

The last step of a lighting renderer: it owns the offscreen buffer the renderer draws one scene’s light into, and multiplies that buffer over the scene.

With bounce configured, what is multiplied over the scene is the light combined with a blurred, low-resolution copy of itself, which spreads light past shadow edges and around corners the way a lit surface throws light back into a room. The copy is a visual treatment and never reaches LightingWorld.levelAt().

A renderer calls invalidate whenever its light changed and render once per frame, so nothing is redrawn while the light stands still.

new LightingComposite(renderer, options): LightingComposite

Defined in: lighting/src/LightingComposite.ts:66

RendererPlugin

LightingCompositeOptions

LightingComposite

destroy(): void

Defined in: lighting/src/LightingComposite.ts:150

Release the buffers and sprites. The source container is left alone.

void


invalidate(): void

Defined in: lighting/src/LightingComposite.ts:120

Mark the light buffer stale, so the next render redraws it.

void


render(): boolean

Defined in: lighting/src/LightingComposite.ts:129

Redraw whatever is stale. Returns whether the light buffer was redrawn, so a caller can skip further work on an unchanged buffer.

boolean


resize(width, height): void

Defined in: lighting/src/LightingComposite.ts:137

Follow a viewport resize. The light buffer is stale afterwards.

number

number

void

Coding agents: fetch https://yage.dev/llms.txt first and prefer the Markdown references it links over these HTML pages. This page's Markdown counterpart is /llms/packages/lighting.md.