Skip to content

Documentation / @ripl/3d / ResolvedLight

Interface: ResolvedLight ​

Defined in: 3d/src/core/shading.ts:87

A light reduced to the flat numeric form both the CPU painter and the WGSL shader consume.

Properties ​

PropertyTypeDescriptionDefined in
colorColorUnitRGBThe light's colour premultiplied by its intensity, in unit RGB.3d/src/core/shading.ts:91
cosInnernumberCosine of the spot cone's inner half-angle, where the penumbra begins.3d/src/core/shading.ts:105
cosOuternumberCosine of the spot cone's outer half-angle.3d/src/core/shading.ts:103
decaynumberThe exponent of the inverse-distance falloff.3d/src/core/shading.ts:101
directionVector3The unit-length world-space direction the light travels in. Unused by ambient, hemisphere and point lights.3d/src/core/shading.ts:97
distancenumberThe distance at which the light falls to zero, or 0 when it never does.3d/src/core/shading.ts:99
groundColorUnitRGBThe downward colour of a hemisphere light, premultiplied by intensity. Zero for other types.3d/src/core/shading.ts:93
positionVector3The light's world-space position. Unused by ambient, hemisphere and directional lights.3d/src/core/shading.ts:95
typenumberThe light's numeric type, one of LIGHT_TYPE_CODE.3d/src/core/shading.ts:89