Skip to main content

Function: gradientColourAt()

function gradientColourAt(gradient: RampGradient, height: number): Rgb;

Defined in: threejs-environment/src/sky-texture.ts:84

The colour at a height up the sphere.

intensity is NOT applied here. three.js has backgroundIntensity and environmentIntensity on the scene, and multiplying bytes in an 8-bit texture would clip everything brighter than white while the scene property does the same job in floating point.

With no equator this is the two-stop ramp the package started with. With one it is two ramps meeting at the horizon, which is what IWSDK's dome has always been and what an app needs to put a bright band at eye level. The exponent shaping applies to the position within whichever half we are in, so a sunset can hold its colour near the ground on both engines.

Parameters

ParameterType
gradientRampGradient
heightnumber

Returns

Rgb