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.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new LightingComposite(
renderer,options):LightingComposite
Defined in: lighting/src/LightingComposite.ts:66
Parameters
Section titled “Parameters”renderer
Section titled “renderer”RendererPlugin
options
Section titled “options”Returns
Section titled “Returns”LightingComposite
Methods
Section titled “Methods”destroy()
Section titled “destroy()”destroy():
void
Defined in: lighting/src/LightingComposite.ts:150
Release the buffers and sprites. The source container is left alone.
Returns
Section titled “Returns”void
invalidate()
Section titled “invalidate()”invalidate():
void
Defined in: lighting/src/LightingComposite.ts:120
Mark the light buffer stale, so the next render redraws it.
Returns
Section titled “Returns”void
render()
Section titled “render()”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.
Returns
Section titled “Returns”boolean
resize()
Section titled “resize()”resize(
width,height):void
Defined in: lighting/src/LightingComposite.ts:137
Follow a viewport resize. The light buffer is stale afterwards.
Parameters
Section titled “Parameters”number
height
Section titled “height”number
Returns
Section titled “Returns”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.