Skip to content

Implement day/night cycle#139

Merged
Purdze merged 2 commits intomasterfrom
feat/day-night-cycle
Apr 6, 2026
Merged

Implement day/night cycle#139
Purdze merged 2 commits intomasterfrom
feat/day-night-cycle

Conversation

@Purdze
Copy link
Copy Markdown
Collaborator

@Purdze Purdze commented Apr 6, 2026

Summary

  • Advance day/night time locally at 20 TPS with server SetTime packets as reconciliation (fixes frozen sky)
  • Fix SetTime packet handling to only update day_time when server sends clock data (empty clock_updates no longer resets time to 0)
  • Add partial-tick interpolation and cubic Bezier easing for smooth celestial motion
  • Fix sun/moon/star rotation and sunrise/sunset glow positioning so sun rises in east, sets in west, and the glow tracks the sun
  • Use separate translucent and overlay (additive) blend pipelines for correct sky rendering
  • Drive clear color and chunk fog from time-of-day keyframes so the horizon blends with the sky

Test plan

  • Connect to a server and observe the sky cycling through day/night smoothly
  • /time set night - sky should immediately darken, sun should be below horizon
  • /time set day - sky should immediately brighten
  • Sunrise/sunset glow should appear near the sun at the horizon
  • Sun rises in the east and sets in the west
  • Sky should not slide relative to terrain when looking up/down
  • Fog at the horizon should blend with the sky color, not show black bands

Purdze added 2 commits April 6, 2026 02:24
- Advance day_time/game_time locally at 20 TPS with server SetTime
  packets as reconciliation
- Only update day_time when server sends clock data
- Add partial-tick interpolation for smooth sub-frame sky animation
- Apply cubic Bezier easing to sun/moon/star angles
- Fix celestial_rotate to correct Y(-90°) * X(angle) rotation
- Fix sunrise/sunset glow transform so the glow tracks the sun
- Use separate translucent and overlay (additive) blend pipelines
- Drive clear color from sky_color and chunk fog from fog_color
- Use camera's actual FOV for sky projection
- Skip dark disc rendering when above world horizon
@Purdze Purdze merged commit d196b4b into master Apr 6, 2026
6 checks passed
@Purdze Purdze deleted the feat/day-night-cycle branch April 6, 2026 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant