ReadonlybaseThe sustained wind in world units/sec. Mutate freely — everything derived from it turns smoothly, because the offsets that consume it are integrated rather than recomputed from a clock.
ReadonlysurfaceReadonlydriftHow far a water surface's ripple pattern has travelled downwind, in world units. Integrated, so a change of wind turns the pattern instead of teleporting it.
Sustained speed in world units/sec.
Sustained heading in radians, from +X toward +Z.
The current gust multiplier on base: 1 is the sustained wind.
Surface wind as a fraction of referenceSpeed: 0 calm, 1 a full
wind, above 1 a storm (capped at 2 so a wild base cannot fold a tree
through the ground). This is the number the shaders scale by.
Radians of gust phase per world unit travelled downwind.
Apply an options bag; unset fields keep their current value.
Point the sustained wind, in radians from +X toward +Z.
Advance the gust, the sway phase, and the water drift by one frame. Call
once per frame from whoever owns this wind — HexWorld does it for the
wind it shares with its WeatherSystem.
One wind for the whole world: the vector that drifts the cloud deck, slants the rain, bends the trees, and marches the ripples across a lake.
Nothing here draws anything. It is a handful of numbers advanced once a frame and read by every system that should agree about which way the weather is going — which is the entire point, because four effects each animating on their own clock is what makes a scene read as four animations instead of as one place with weather in it.
Sustained versus surface
base is the sustained wind: mutate it freely, and it is what the cloud deck drifts by. surface is what a gust is doing right now —
baseswung in speed by gustiness and in direction by turbulence — and it is what the rain and the plants follow. A whole overcast deck does not surge in a two-second gust; the hedge under it does, and having both available is what lets each take the one that is true of it.Why phase is integrated
phase accumulates on the CPU rather than being recovered in a shader as
time × rate. Multiplying a shared clock by a changing rate rewinds the wave's phase every time the wind picks up, which reads as the trees briefly swaying backwards. The same reasoning keeps the cloud offset and drift on the CPU.Example