Real seconds per full cycle when animating.
Freeze/unfreeze the clock (setTime still works while paused).
Jump the clock (value wraps into 0–1).
Advance the clock by dt real seconds (no-op while paused).
Compute the lighting state for the current time. The returned object and its vectors/colors are reused across calls — copy anything you keep.
Evaluate and push the state onto scene objects: sun rig (or plain light), ambient light, terrain material uniforms, liquid tints, scene background, the sky dome, and its god rays. Returns the applied state.
Time-of-day model: an animated clock mapped to sun/moon direction, light and ambient colors with warm dawn/dusk tinting, a cool moonlight mode at night, and matching sky + liquid tints. Pure state machine — pair it with DayNightTargets via applyTo to drive a scene, or read evaluate and push the values yourself.
One directional light plays both roles: while the sun is up it is the sun; at night it swaps to the moon's direction (exactly opposite) with a dim blue color. The swap happens at the horizon, where both intensities are zero, so it is never visible.
Example