Skip to main content

Module sky

Module sky 

Source
Expand description

Procedural atmosphere: time of day drives the sun/moon direction, light colour and ambient. The renderer draws the sky itself from the same settings, so light and sky always agree.

Structs§

SkySettings
Serializable procedural sky, celestial lighting and day/night animation controls.

Functions§

ambient
Hemisphere ambient light colour for the time of day.
main_light
The strongest light in the sky right now: (direction towards it, linear colour, intensity). The sun by day (orange near the horizon), a dim blue moon at night.
moon_illumination
Fraction of the moon’s disc that is lit: 0 at new moon, 1 at full moon.
sun_direction
Unit vector pointing from the world towards the sun. Rises in +X at 6:00, peaks at noon, sets in -X at 18:00.