Log inGet started
Package

example_day_and_night.sceneSetup

Newest version

This package holds more than this page lists. See all of its files in its world.

README.md

Example: day and night

An example scene setup whose whole lighting follows the hour of its sky. It composes a sky drawn by the procedural backdrop with its dawn and night colours on, a directional sun that follows that sky, a moonlight, an ambient light, a sky light and height fog.

What it demonstrates: the sky states the hour once, and every other member follows it. The sun takes its direction, colour and strength from the sun the sky draws and is out after dark. The moonlight, the ambient light and the fog colour are stated by hour ({ byHour = { ... } }): each is given its value at named hours and receives the value at the hour the sky draws, blended between them, so moving sky/backdrop/timeOfDay (or running the day with sky/backdrop/autoCycle) carries the whole scene from day through dusk to a dark, moonlit night and back through dawn.

HourSkySunMoonlightAmbientFog
07:30 to 16:30blueupout0.35, cool greyday grey
16:30 to 19:30dusk tint, then nightsinks, out at 18:00rises from 17:45falls to 0.05darkens
19:30 to 05:00night, stars, moonout0.120.05, bluenight blue
05:00 to 07:30dawn tint, then bluerises at 06:00out by 06:15rises to 0.35lightens

A placement overrides any of them for its scene, by hour or as one value: setup:set("ambient/intensity", { byHour = { ["06:00"] = 0.3, ["21:00"] = 0.02 } }).

Its sky and lights are its own assets, in this folder: sky.sky, sun.sceneLight, moon.sceneLight and ambient.sceneLight.