Creates weather over world (or over a uniform options.climate without one).
Settings; anything not given uses DEFAULT_WEATHER.
Optional threejs-biomes world for climate (temperature at altitude, moisture, water).
Optionalframe: LocalFrame
Frame positions are given in; defaults to world.frame.
ReadonlyframeThe frame positions are given in.
Resolved settings. Change them with Weather.set / Weather.reset.
Bumped on every change; caches compare it.
ReadonlyworldThe world whose climate drives the weather, or null (then options.climate is used everywhere).
Unit vector the prevailing wind blows towards, [x, z].
The weather at local (x, z) at time seconds.
Optionalclimate: ClimatePoint
Pass a cached ClimatePoint for this position to skip sampling the world (the climate never changes with time, so per-texel or per-instance caches are exact).
Static climate at local (x, z): from the world, or options.climate without one.
Replaces all settings: anything not in input goes back to the defaults.
Merges input into the current settings (nested objects merge, arrays replace).
Every lightning strike inside the box [minX, maxX] × [minZ, maxZ] (frame coordinates) with
t0 <= time < t1, sorted by time. Deterministic: the same window always gives the same strikes,
and splitting a window into pieces gives the same strikes as asking for it whole.
Rain and snow accumulated on the ground at local (x, z) by time: the last surface.memory
seconds of weather integrated with drying and melting. Still a pure function of time (it re-samples
the history), so scrubbing works. Costs surface.samples × Weather.at.
Optionalclimate: ClimatePoint
Seeded, time-driven weather over a world: weather systems that drift with the prevailing wind (advected noise), cloud cover, rain/sleet/snow from the world's temperature at altitude, wind with gusts and slow veering, humidity, fog, and thunderstorm cells with lightning. Climate-aware: deserts rarely rain, rainforests often do, mountains get snow.
Everything is a pure function of the seed, the world, the position and the time, so you can scrub time backwards and forwards and always get the same weather. Positions are local frame coordinates (
xeast,zsouth) offrame(the world itself on a flat world).Example