Renderer · interface
PointLightSource
Explained in Hello world.
interface PointLightSourceimport type { PointLightSource } from '@driftengine/core';Properties
| Name | Type | Description |
|---|---|---|
x | number | |
y | number | |
z | number | |
r | number | |
g | number | |
b | number | |
radius | number | Distance in metres at which illumination falls to zero. |
flicker | number | Colour modulation amplitude; zero keeps a steady source. |
shadowNear | number | Shadow cubemap near plane in metres. |
sourceRadius | number | Physical emitter radius in metres, used to derive penumbra width. |
dirXoptional | number | Where a spot points, as a world-space direction. Absent makes this a point light.MoreNormalised here rather than trusted, because an un-normalised direction scales the cosine the cone is compared against and shows as a cone of the wrong width — which reads as the angle having been set wrong rather than as the vector. |
dirYoptional | number | |
dirZoptional | number | |
coneInnerDegoptional | number | The cone's inner and outer half-angles in degrees. Full brightness inside the inner, nothing
outside the outer, a smooth edge between.MoreA narrow cone is not free, and the cost is the shadow rather than the shading. A spot's shadow takes a layer of the same octahedral array a point light's does, and that layer covers the whole sphere — so a 45 degree cone uses about 15% of it, roughly 0.38 of the linear resolution, and a 10 degree cone about 0.13. Comfortable for a lamp; visibly coarse for a stage spotlight, which is the measurement that would justify giving spots a perspective map. |
coneOuterDegoptional | number | |
iesProfileoptional | number | Which photometric profile shapes this light, as a row of the atlas setIesProfiles uploaded.MoreApplies to a point light as well as a spot. A bare bulb has a measured distribution too, and a fixture's own profile is usually a better description of it than any cone. Absent, or negative, is a light with no profile. |
castsShadowoptional | boolean | Whether this light is worth a shadow cubemap. Defaults to true.MoreA light whose That is not hypothetical: pulsing floor markers animate a squared fade into
|
inLightFieldoptional | boolean | Whether a DriftLight field also sums this light (createLightField sets it).MoreThen the lit shader shades it exactly only where the choice is complete and lets the field's summed light take over past it, so the light is never counted twice. Carried to the shader as the sign of the light's weight, which both light paths already have: no new storage on a part whose uniform budget has none to spare. |
falloffExponentoptional | number | How the light fades with distance when it names its own way: (1 - (d/R)^2)^n with no distance
term, R its radius and n this. The usual falloff for a light without inverse-square
falloff, so a rig authored that way — a fill of brightness 160 across 164 m, a key at exponent
8 — lights the space it was authored for rather than one that ends a few metres out. Absent or
0, the frame's own falloff (pointLightFalloff), which is every light before 4.8.7. |