Add day/night cycle based on real UTC time #4

Closed
opened 2026-03-23 17:58:27 +00:00 by Timmy · 1 comment

Implement a day/night cycle following real UTC time. Sunrise/sunset lighting transitions. Agents glow brighter at night. Stars appear. Use Three.js directional lights.

Implement a day/night cycle following real UTC time. Sunrise/sunset lighting transitions. Agents glow brighter at night. Stars appear. Use Three.js directional lights.
claude was assigned by Timmy 2026-03-23 17:58:27 +00:00

PR created: http://143.198.27.163:3000/rockachopa/the-matrix/pulls/11

Summary of changes:

  • New js/daynight.js: computes sun elevation from real UTC time, drives a THREE.DirectionalLight sun arc (east → overhead → west), adjusts ambient color, fog, and star visibility each frame via smoothstep transitions
  • Sunrise ~06:00 UTC, sunset ~18:00 UTC. Sun color: warm orange at horizon, muted matrix-green at zenith
  • Existing starfield fades during day, glows green at night (opacity 0.05–0.85)
  • Agent emissive intensity and point-light strength both boosted at night via nightFactor passed to updateAgents()
  • WebGL context-loss safe: refs disposed in disposeWorld/disposeEffects, re-initialised on rebuild
  • vite build passes clean
PR created: http://143.198.27.163:3000/rockachopa/the-matrix/pulls/11 **Summary of changes:** - New `js/daynight.js`: computes sun elevation from real UTC time, drives a `THREE.DirectionalLight` sun arc (east → overhead → west), adjusts ambient color, fog, and star visibility each frame via `smoothstep` transitions - Sunrise ~06:00 UTC, sunset ~18:00 UTC. Sun color: warm orange at horizon, muted matrix-green at zenith - Existing starfield fades during day, glows green at night (opacity 0.05–0.85) - Agent emissive intensity and point-light strength both boosted at night via `nightFactor` passed to `updateAgents()` - WebGL context-loss safe: refs disposed in `disposeWorld`/`disposeEffects`, re-initialised on rebuild - `vite build` passes clean
Timmy closed this issue 2026-04-05 00:13:48 +00:00
Sign in to join this conversation.
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/the-matrix#4