Day-Night Cycles, Lighting and Weather in 3D Games
How games create time of day and weather: a moving sun, sky, shadows, baked and real-time light, fog, rain, wet roads and neon at night.

Time of day and weather make an open world feel alive. A city at sunrise, in a storm or under neon lights at night feels like a different place with the same buildings. Technically this comes from a few systems working together: a moving sun, a sky, shadows, global lighting, and effects such as fog and rain.
The sun and the sky
The sun is a directional light that rotates around the world once per game day. Its angle decides the length of the shadows, its colour changes from warm at dawn to white at noon, and its brightness falls to nothing at night. The sky follows with a colour gradient or a sky model, and stars and a moon fade in. A game day is much shorter than a real day, often 30 to 60 minutes.
Baked and real-time lighting
- Real-time lighting is calculated every frame, so it can change with the time of day, but it is expensive
- Baked lighting is calculated in advance and stored in textures, which is fast but cannot change
- Most games mix both, for example baked light for static buildings and real-time light for the sun and moving objects
- Light probes give moving objects, such as cars, the correct light from the area around them
Modern engines add dynamic global illumination, which lets light bounce between surfaces in real time, for example Lumen in Unreal Engine 5. It looks great and needs a powerful device.
Shadows
Shadows give depth and cost a lot. Cascaded shadow maps split the view into zones, with sharp shadows close to the camera and softer ones farther away. The distance and the quality of shadows are common settings to change for weaker devices, as discussed in how big 3D cities render fast.
Weather
- Fog and haze change how far the player can see and create mood
- Rain and snow are particle systems that follow the camera
- Wet surfaces use lower roughness, so roads shine and reflect lights
- Clouds can be flat textures or volumetric, and storms can add lightning and wind
- Weather can change gameplay: slippery roads, lower visibility, different traffic
Night in the city
At night the city becomes a light show. Streetlights, signs and car headlights switch on by a timer linked to the sun. Emissive materials make windows and neon glow, and a bloom effect adds a soft halo. Many lights are faked, because real-time lights are limited. A few real lights near the player and many glowing surfaces give the look at a low cost.
Time of day and gameplay
Time can also affect rules: shops that close, different people on the streets, missions that only start at night. The server controls the clock in an online game so that all players see the same time (multiplayer architecture). See how online open-world games are made for the full overview.
Frequently asked questions
How does a day-night cycle work in a game?
A directional light, the sun, rotates around the world over a set time, and its colour, brightness and the sky change with its angle. Streetlights and other lights switch on when the sun goes down.
What is baked lighting?
Baked lighting is light calculated in advance and stored in textures. It is fast to draw but it cannot change at runtime, so it is used for static objects.
How do games make wet roads?
They lower the roughness of the road material when it rains, so the surface becomes shiny and reflects lights. Puddles and splash effects add more detail.

