3 Commits
Author SHA1 Message Date
sunxfancy 8926d7516b feat(daynight): expose attenuated sun color 2026-08-23 16:34:49 +08:00
sunxfancy 9a6a92d41f feat(daynight): add atmospheric scattering sky model 2026-08-23 16:27:50 +08:00
西风逍遥游 7f64b19550 feat(daynight): time-of-day cycle with solar orbit, procedural skybox and night lighting
Add a DayNight module (src/modules/daynight) exposing eve.DayNight() to script:
- A 24-hour clock (configurable speed / pause) derives the sun elevation and
  azimuth each frame, repositioning the directional light so the sun sweeps the
  sky over the day and fades to zero below the horizon.
- A procedural IBL sky cubemap (sky gradient + sun disc + deterministic night
  stars) is regenerated per sun-angle bucket and registered as the 3D env map,
  so both the skybox angle and the reflected sky follow the sun.
- Night light systems, each a set of Light3D entities toggled by name:
  moonlight (cool directional), starlight (ambient boost), fire (warm point
  light at a set position) and fireflies (a ring of gently-drifting points).

Add examples/daynight: a 3D diorama with a UI panel and hotkeys to pause/speed
the clock and toggle moonlight, fire and fireflies.

Add test/daynight.cpp (9 cases) and docs/usr/modules/daynight.md. Verified with
a syntax-only compile per the weather module precedent.
2026-08-16 03:55:38 +08:00