Skip to content

Function: findDominantLightWorldPos()

ts
function findDominantLightWorldPos(root, out): boolean;

Writes the world-space position of the brightest PointLight or DirectionalLight found anywhere under root into out.

For directional lights, a virtual point is projected along -direction at a large distance so that normalize(out - fragWorldPos) yields a near-parallel light direction — matching the expectation of shaders that model the light as a point source.

Parameters

ParameterType
rootObject3D
outVector3

Returns

boolean

true when a light was found, false when the scene has none (caller should leave out at its last known value / default).

Distribué sous la licence indiquée dans le dépôt.