voxolith

timeOfDay()

Every lighting field of the renderer's FrameParams for a time of day: key light, ambient, sun and moon discs, sky colours. By day the key light follows the sun; at night it is a dim blue moonlight and the ambient drops low enough for point lights to carry the scene. The moon disc lights nothing;...

function timeOfDay(phase: number, opts?: TimeOfDayOptions): Lighting;

Defined in: engine/src/atmosphere/timeofday.ts:69

Every lighting field of the renderer's FrameParams for a time of day: key light, ambient, sun and moon discs, sky colours. By day the key light follows the sun; at night it is a dim blue moonlight and the ambient drops low enough for point lights to carry the scene. The moon disc lights nothing; the key light does.

Parameters

ParameterTypeDescription
phasenumber0..1 over a day (wrapped): 0 midnight, 0.25 sunrise, 0.5 noon, 0.75 sunset. Animate it to animate the sky.
opts?TimeOfDayOptions-

Returns

Lighting

The lighting, to spread into renderer.render or pass to atmosphereFrame.

Example

renderer.render({ ...frame(), ...timeOfDay(0.42) });

On this page