Fog

Fog is not creatable, there's only one instance of it. It can only be accessed through its globally exposed variable.

Fog is a shortcut to Client.Fog.

Fog gives control over distance fog settings.

Properties

Color of the fog, default is RGB (0, 95, 139).

Sets Fog.Near while maintaining offset between Fog.Near & Fog.Far

Fog.Distance = 100

Distance at which Fog ends, in world units. Default value is 400.

Anything between Fog.Near and Fog.Far is progressively colored by fog, up to maximum fog opacity at Fog.Far and beyond.

Fog.Far = 100
-- both near and far can be set at once this way
Fog.Near, Fog.Far = 50, 100

Integer or table of integers between 1 and 8. Cameras only render the fog if it corresponds to their layers.

Fog absorption factor regarding light blocks and light objects, default is 0.4.

0.0 ➡️ the color can 100% be seen through the fog.
1.0 ➡️ the color is totally absorbed, like any other block.

Fog.LightAbsorption = 0.1

Distance at which Fog starts, in world units. Default value is 200.

Anything closer than Fog.Near is not affected by the fog. Anything between Fog.Near and Fog.Far is progressively colored by fog.

Fog.Near = 50

Enables or disables Fog.

Fog.On = true
Fog.On = false
-- toggles fog
Fog.On = not Fog.On