Renderer · interface
PointLightBuffer
Explained in Hello world.
interface PointLightBufferimport type { PointLightBuffer } from '@driftengine/core';Properties
| Name | Type | Description |
|---|---|---|
positionsreadonly | Float32Array | |
colorsreadonly | Float32Array | |
radiireadonly | Float32Array | |
sourceRadiireadonly | Float32Array | Each selected light's emitter radius, in metres, packed beside its falloff radius.MoreA light has a size, and a highlight has to know it. The shading treated every source as a mathematical point, so its reflection in a polished surface was a point too: smaller than a fragment, landing in some pixels and not their neighbours. That is the bright speckle a dark glossy model shows under a close lamp, and it cannot be filtered away afterwards because the information was never sampled. A real emitter subtends an angle, and a headlight a few centimetres from a wing subtends a very large one.
|
considered | number | How many sources were offered this frame, against the count that won a slot.MoreReported from outside, and it turned an afternoon into a glance. A scene was submitting 63 lights against a budget of 10, so the whole budget went to static scenery between 7 and 23 metres away and the rig that answered the music never got a slot. Nothing flickered and nothing warned, because the selection did exactly what it documents; the symptom reported by a person was "the lights are poor", which leads nobody to a light budget. The count had to be recovered by walking the array in a console. Reading it costs nothing and it is the only figure that makes the ratio visible: 63 offered and 10 bound is a scene to prune, 12 offered and 10 bound is a scene that is fine. |
count | number | |
sourceIndexreadonly | Int32Array | |
weightsreadonly | Float32Array | How present each chosen light is, 0 to 1, against the two boundaries it can be
crossing: the edge of view range, and the budget cut it shares with the nearest
light that missed the set.MoreDeliberately not folded into |
directionsreadonly | Float32Array | Three per slot: where a spot points, normalised. Zeroes for a point light.MoreFilled for every slot rather than only for spots, because a slot keeps whatever the last light to hold it wrote — and a stale direction on a light that is now a point is a cone pointing somewhere it was never aimed. |
coneCosreadonly | Float32Array | Two per slot: the cosine of the inner cone angle, then of the outer. |
falloffExponentsreadonly | Float32Array | One per slot: the light's own falloff exponent, or 0 for the frame's falloff. See
PointLightSource.falloffExponent. |
iesProfilesreadonly | Float32Array | One per slot: a row of the photometric atlas, or −1 for a light with no profile. |
scratchDistancereadonly | Float32Array | Internal insertion-sort storage; exposed only to keep one flat object. |
shadowIndexreadonly | Int32Array | The nearest POINT_SHADOW_POOL lights, nearest first — a superset of the shaded
ones, and the reason a light no longer pops when it enters the sampled set.MoreBefore the shadow pool every light owned a permanent cubemap, so being chosen for shading meant the shadow was already correct. Borrowed maps broke that: joining the set meant evicting somebody and baking six faces at two a frame. The pool has always had four slots more than the shader can bind; these are the lights they are for, kept baked before they are wanted. |
shadowCount | number | |
complete | number | How far from the selection's centre the choice is complete for DriftLight field lights: a point nearer than this is reached only by field lights chosen at full strength. A field light left out at distance d reaching r first reaches d - r; one dimmed at the cut counts as left out. At most the view range, past which nothing is chosen. |