example_day_and_night.sceneSetup
- .metadata267 B
- README.md1.6 KB
- sceneSetup.yaml1.1 KB
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.
| Hour | Sky | Sun | Moonlight | Ambient | Fog |
|---|---|---|---|---|---|
| 07:30 to 16:30 | blue | up | out | 0.35, cool grey | day grey |
| 16:30 to 19:30 | dusk tint, then night | sinks, out at 18:00 | rises from 17:45 | falls to 0.05 | darkens |
| 19:30 to 05:00 | night, stars, moon | out | 0.12 | 0.05, blue | night blue |
| 05:00 to 07:30 | dawn tint, then blue | rises at 06:00 | out by 06:15 | rises to 0.35 | lightens |
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.