PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

FogColor

Lighting

Color3

A DataType/Color3 value giving the hue of Lighting's fog.

How does fog work?

Fog in Roblox is displayed in a plane perpendicular to the Workspace/CurrentCameras direction. It fades between the Lighting/FogStart property where it is not visible, to the Lighting/FogEnd property where it is fully opaque. The effect of fog is it blends color with the FogColor.

At distances greater than Lighting/FogEnd, color will be determined entirely by the FogColor. However at distances between Lighting/FogStart and Lighting/FogEnd the degree to which the color is blended depends on the position.

Roblox’s fog uses linear interpolation between Lighting/FogStart and Lighting/FogEnd. This means if Lighting/FogStart is 10 and Lighting/FogEnd is 20, at a distance of 15 studs the fog will be at 50%. That means the color of a pixel at 15 studs will be 50% its normal color blended with 50% of the fog color.

local Lighting = game:GetService("Lighting")
-- fog will fade between 25 and 200 studs
Lighting.FogStart = 25
Lighting.FogEnd = 200

Note, fog does not obscure the skybox.

For more information about fog please see this blog post.