This is meant to accelerate your game development by skipping a lot of boilerplate.
Hey everyone!
I wanted to share a package that aims to accelerate game development by taking care of the foundational sky and lighting features that most game 3D worlds need, without requiring you to reinvent the wheel.
Check out the Live Demo on CodePen →
The goal is simple:
Reduce the effort you spend upfront on basic environment systems so you can focus entirely on gameplay.
Instead of spending days wiring together sky colors, sun motion, light updates, clouds, stars, and shaders, you can drop this in and immediately get a complete atmosphere that just works.
Features
Dynamic day–night cycle
-
Real sun and moon positioning throughout the day
-
Smooth transitions: sunrise → midday → sunset → night
-
Adjustable azimuth, elevation, intensity, and color
-
Works with any FOV (60–120+) without lensflare parallax issues
-
Atmospheric falloff and gradients
-
Configurable sky/ground color blending
Physically-inspired night sky
-
High-density starfield with separate, individual star flickering
-
Color-corrected horizon glow
-
Moonlight intensity scaling
-
Time-driven transitions with no popping or harsh cuts
Performance-friendly Clouds
-
Procedural scrolling cloud layers
-
Color tinted automatically based on sun angle
-
Adjustable density, height, scale, and speed
-
Zero overdraw flicker
Lensflare system (infinite-distance flare, no parallax)
-
Enhanced version of the classic three.js Lensflare
-
Custom screen-space override to eliminate parallax
-
Works reliably at ultra-wide resolutions
-
Fully color-corrected textures included
-
Optional bloom-friendly mode
Skybox
-
Physically blended top/bottom sky colors
-
Configurable sun size for stylized or realistic look
-
Night-day shader is all in linear space (correct for PBR)
Lighting & Shadows
-
Auto-updated DirectionalLight synced with sun
-
Optional ambient fill light
-
Smooth intensity ramping based on time-of-day
-
Correct shadow camera handling
Dev-friendly design
-
Fully modular classes you can drop into any project
-
Designed to scale to large open worlds.
Why I built this
Every game needs a sky, sun, stars, a day-night cycle, and basic lighting.
Developers often spend weeks building a sky system from scratch, only to end up with something that still has:
-
wrong colors
-
incorrect gamma
-
popping transitions
-
broken lensflare parallax
-
misaligned sun/mouse input
-
mismatched shadows
I wanted to provide something that skips all that boilerplate and gives you a system that “feels shippable” right out of the box.
There is room for performance improvement such as object pooling, throttling updates, etc., but those are pretty trivial given the existing code structure, so I decided to wrap up as-is.
I hope you enjoy the demo. You can play with the time controls, timescale, and toggle helpers on/off as needed. Would love to hear what people think.
If this saves anyone time in their own projects, then it has done its job.