ShaderLightingRenderer
Defined in: lighting/src/ShaderLightingRenderer.ts:104
Draws soft-edged radial lights into an offscreen buffer, then multiplies that buffer over the scene.
Each light is one quad whose fragment shader runs the projection
LightingWorld.levelAt() runs: the lamp is a line of width size square to
the direction from the shaded pixel, every occluder in reach hides a stretch
of it, and what is left is how brightly that pixel is lit. A shadow’s border
therefore widens with the distance from the blocker, a lamp wider than its
blocker lights around it, and a cone’s softness fades its edge — all from
one formula, with no geometry per shadow.
The drawn picture is what levelAt() answers, within the coverage steps the
shader counts in and the light buffer’s 8 bits per channel. Occluder shapes
reach the shader through one data texture the scene’s lights share, rebuilt
only for the lights that moved.
The bounced light the scene resolved to reaches the picture through LightingComposite, which every lighting renderer shares.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ShaderLightingRenderer(
context,options?):ShaderLightingRenderer
Defined in: lighting/src/ShaderLightingRenderer.ts:122
Parameters
Section titled “Parameters”context
Section titled “context”options?
Section titled “options?”ShaderLightingRendererOptions = {}
Returns
Section titled “Returns”ShaderLightingRenderer
Methods
Section titled “Methods”destroy()
Section titled “destroy()”destroy():
void
Defined in: lighting/src/ShaderLightingRenderer.ts:189
Release every resource owned by this scene’s backend.
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”render()
Section titled “render()”render(
frame):void
Defined in: lighting/src/ShaderLightingRenderer.ts:171
Synchronize the backend with the world’s current lights and view.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”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.