Use Lighting, Sky, Atmosphere, and PostEffects to turn a flat workspace into a world with time of day, fog, and bloom.
A flat white feels like a test room. and atmosphere give your world depth, mood, and time of day — sunrise, night, fog over a swamp, bloom on neon signs. These aren't just decoration; they're the first thing notice.
The Lighting service controls the global light:
local Lighting = game:GetService("Lighting")
Lighting.ClockTime = 14 -- 2:00 PM (0 = midnight, 12 = noon)
Lighting.GeographicLatitude = 0 -- angle of the sun
ClockTime is the simplest lever — a number from 0 to 24 that sets the sun position. 6 is sunrise, 12 is noon, 18 is sunset, 0 is midnight.
Setting Lighting.ClockTime to makes it noon (sun directly overhead).
A skybox and atmosphere add realistic depth:
local sky = Instance.new("Sky")
sky.SunTextureId = "rbxassetid://0" -- default sun
sky.MoonTextureId = "rbxassetid://0" -- default moon
sky.StarCount = 3000
sky.Parent = Lighting
local atmosphere = Instance.new("Atmosphere")
atmosphere.Density = 0.3 -- fog thickness (0 = clear, 1 = thick)
atmosphere.Color = Color3.fromRGB(200, 220, 255) -- tint
atmosphere.Haze = 2 -- haze amount
atmosphere.Parent = Lighting
Density controls how much the horizon fades into the sky — low values for clear days, high for foggy swamps.Haze adds a warm or cool haze layer.Sky object renders the skybox behind everything.Together they turn a gray void into a sky with clouds, a sun, and realistic horizon fading.
Built-in fog hides distant objects and adds atmosphere:
Lighting.FogEnd = 1000 -- objects beyond 1000 studs fade to fog color
Lighting.FogColor = Color3.fromRGB(180, 200, 220)
FogEnd is the distance where objects are fully fogged. For a horror game, set it to 50 — the can barely see. For an open world, set it to 5000 for subtle depth.
Atmosphere and FogStackingDensity work together — Atmosphere gives realistic sky-based fog, while FogEnd gives a simple distance cutoff. Use one or both.
PostEffects add camera-level visual polish:
local bloom = Instance.new("BloomEffect")
bloom.Intensity = 0.5 -- glow strength
bloom.Size = 24 -- glow spread
bloom.Threshold = 0.8 -- brightness cutoff
bloom.Parent = Lighting
local colorCorrection = Instance.new("ColorCorrectionEffect")
colorCorrection.Brightness = 0.02
colorCorrection.Contrast = 0.1
colorCorrection.Saturation = 0.2
colorCorrection.Parent = Lighting
Which PostEffect makes bright objects glow?
A simple day/night :
while true do
for t = 6, 20, 0.1 do -- sunrise to sunset
Lighting.ClockTime = t
task.wait(0.05)
end
for t = 20, 30, 0.1 do -- sunset to next sunrise (wraps past 24)
Lighting.ClockTime = t % 24
task.wait(0.05)
end
end
This smoothly advances the sun across the sky. Combine with Atmosphere density changes (thicker fog at dawn, clear at noon) for a more dynamic feel.
Write a loop that sets Lighting.ClockTime to 6, then increments it by 0.1 every frame until it reaches 18 (sunrise to sunset).
local Lighting = game:GetService("Lighting")
-- advance ClockTime from 6 to 18task.wait() between updates.Next: — asking the world what's in the way.