Skip to content

Documentation / @ripl/3d / LIGHT_DIRECTION

Variable: LIGHT_DIRECTION ​

const LIGHT_DIRECTION: Readonly<{ back: Vector3; bottom: Vector3; bottomLeft: Vector3; bottomRight: Vector3; front: Vector3; left: Vector3; right: Vector3; top: Vector3; topBack: Vector3; topFront: Vector3; topLeft: Vector3; topLeftBehind: Vector3; topLeftFront: Vector3; topRight: Vector3; topRightBehind: Vector3; topRightFront: Vector3; }>

Defined in: 3d/src/core/constants.ts:20

Pre-normalized light direction vectors for common light positions.

Each entry is normalized at module load from its exact axis combination, so a diagonal is a true unit vector rather than a rounded decimal — Context3D.getLightDirectionForRender and the WGSL shader both assume unit length and a truncated one biases every diagonal light slightly dim.