pub struct FogConfig {
pub color: Option<[f32; 4]>,
pub range: Option<[f32; 2]>,
pub density: Option<f32>,
pub horizon_color: Option<[f32; 4]>,
pub horizon_blend: Option<f32>,
}Expand description
User-facing fog/atmosphere configuration.
Mirrors MapLibre’s sky / Mapbox’s fog style properties.
When attached to a StyleDocument or set directly on [MapState],
these values override the default pitch-based atmospheric fog.
Omitted fields (None) fall back to the automatic camera-derived
defaults so users can override only the aspects they care about.
Fields§
§color: Option<[f32; 4]>Fog tint colour (RGBA, linear).
When None, derived automatically from the background colour and
camera pitch (the existing atmospheric-clear-colour behaviour).
range: Option<[f32; 2]>Fog range as [start, end] — fractions of the camera visible range.
0.0 = at the camera eye, 1.0 = at the computed visible-range
horizon. Default: [0.55, 1.05].
density: Option<f32>Peak fog density [0.0, 1.0].
When None, the density is computed from camera pitch (0 at
top-down, ramping to 0.9 near the horizon).
horizon_color: Option<[f32; 4]>Horizon / sky colour (RGBA, linear).
Used as the clear-colour background when the camera is pitched
toward the horizon. When None, derived from the base
background colour.
horizon_blend: Option<f32>Horizon blend factor [0.0, 1.0].
Controls how strongly the horizon colour mixes into the
background as pitch increases. When None, automatic.