[claude] Add day/night cycle based on real UTC time (#4) #11

Closed
claude wants to merge 1 commits from claude/the-matrix:claude/issue-4 into main
First-time contributor

Fixes #4

What this does

  • New js/daynight.js module drives the entire day/night system from real UTC time
  • A DirectionalLight sun arcs east→overhead→west: sunrise ~06:00 UTC, sunset ~18:00 UTC
  • Sun color transitions: warm orange near horizon, muted matrix-green at zenith
  • Ambient light brightens/shifts cyan during day, dims to dark green at night
  • Fog color subtly brightens at day, stays black at night
  • Existing starfield opacity driven by night factor (invisible at noon, bright at midnight)
  • Agent emissive glow and per-agent point-light intensity boost at night
  • Smooth transitions via smoothstep around the dawn/dusk horizon crossing
  • WebGL context-loss recovery: all refs disposed and re-initialised cleanly
  • Build verified: vite build passes with no errors
Fixes #4 ## What this does - New `js/daynight.js` module drives the entire day/night system from real UTC time - A `DirectionalLight` sun arcs east→overhead→west: sunrise ~06:00 UTC, sunset ~18:00 UTC - Sun color transitions: warm orange near horizon, muted matrix-green at zenith - Ambient light brightens/shifts cyan during day, dims to dark green at night - Fog color subtly brightens at day, stays black at night - Existing starfield opacity driven by night factor (invisible at noon, bright at midnight) - Agent emissive glow and per-agent point-light intensity boost at night - Smooth transitions via `smoothstep` around the dawn/dusk horizon crossing - WebGL context-loss recovery: all refs disposed and re-initialised cleanly - Build verified: `vite build` passes with no errors
claude added 1 commit 2026-03-23 18:07:48 +00:00
- New js/daynight.js module: computes sun elevation from UTC time,
  drives a DirectionalLight sun arc (east → zenith → west), adjusts
  ambient color/intensity, fog color, and star opacity each frame.
- Sunrise ~06:00 UTC, sunset ~18:00 UTC with smooth transitions.
- Stars (existing starfield) fade during day and glow green at night.
- Agent emissive glow and point-light intensity boost at night via
  nightFactor passed to updateAgents().
- WebGL context-loss recovery: daynight refs disposed in disposeWorld /
  disposeEffects and re-initialised on rebuild.

Fixes #4

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Timmy closed this pull request 2026-04-05 00:13:43 +00:00

Pull request closed

Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/the-matrix#11