world.weather.getFogThickness()Get the current fog thickness in meters. Returns zero if fog is not present.
world.weather.setFogThickness(thickness)
Instantly sets fog thickness in meters. The current fog animation is always discarded. Set zero to disable the fog.
Actual limits: [100; 5000]
Fog thickness cannot be greater than the clouds lower bound, it will be clamped.
world.weather.getFogVisibilityDistance()Get the current maximum visibility distance in meters. Returns zero if fog is not present.
world.weather.setFogVisibilityDistance(visibility)
Instantly sets the maximum visibility distance of fog at sea level when looking at the horizon. In meters. The current fog animation is always discarded. Set zero to disable the fog.
Actual limits: [100, 100'000]
world.weather.setFogAnimation(...)Sets fog animation keys. Time is set in seconds and relative to the current simulation time, where time=0 is the current moment. Time must be increasing. Previous animation is always discarded despite the data being correct.
world.weather.setFogAnimation(
{-- relative time (seconds), visibility (meters), thickness (meters)
{5, 1000, 500},...,
{50, 2000, 400},})
If the first key time is greater than zero, the animation begins from the current fog state. Set time=0 in the first key to immediately apply fog changes. Set thickness=0 or visibility=0 to remove the fog in a particular key.
world.weather.setFogAnimation() and world.weather.setFogAnimation({}) are valid calls to discard the current animation.
Fog thickness cannot be greater than the clouds lower bound, it will be clamped.