Rendering

Environment

12 symbols, imported from @driftengine/core.

Explained in Sky and atmosphere.

Interfaces

CelestialSite
Where in the world, and when in the year, the sky is being sampled.
CelestialState
DaylightKey
The lighting at one point of the palette's scalar. Every colour is linear and may exceed one.
DaylightPalette
Keys in ascending order of at, validated once. Build with createDaylightPalette.
DaylightState
One moment of the palette, written in place by resolveDaylight.

Functions

celestialStateAt
Convert a timestamp and an authored azimuth into sky state.
createCelestialState
createDaylightPalette
Sort and check the keys. Throws at construction, so a bad palette never reaches a frame.
createDaylightState
easeExposure
current moved toward target over dtSec, closing half the distance in stops every halfLifeSec.
moonIllumination
Visible fraction: new at 0/1, quarters at 0.25/0.75, full at 0.5.
resolveDaylight
The palette at at, into out. Past either end the nearest key holds.