Repository navigation
wthrr v1.1
wthrr 1.1 — Clear Skies, and twice as fast
A new weather scene for fair weather, a fix for Live Weather showing the wrong conditions, and a performance pass that roughly halves wthrr's CPU use.
Source: github.com/todddube/wthrr_mac
Clear Skies
A seventh weather mode, built for the days when there is no weather to speak of.
- The sun tracks the sky by the clock — low and golden on the left at sunrise, high and blue-white at midday, low on the right at sunset. The position moves continuously through the day rather than snapping between fixed spots.
- Volumetric light shafts fan out from the sun, each breathing in width and length on its own phase. Toggle them with the Sun Rays switch.
- Lens flare — ghost discs spaced along the axis from the sun through the centre of the screen.
- Big sunlit cumulus — two to three times wider than the precipitation clouds and spread through the upper half of the sky. Every cloud is shaded from the same direction as the sun, so the whole flock reads as one coherent scene.
- Drifting motes of pollen and dust, about a third of which rise on thermals. Motes near the sun brighten, warm, and pick up a soft bokeh halo.
- Night sky — after sunset the scene becomes a cratered moon over a field of twinkling stars.
- Birds cross the sky using the same Bird Count, Size, and Wildness controls as Aurora.
Live Weather accuracy
Live Weather was mapping several WMO codes to the wrong effect. Every branch now matches the real conditions:
- Clear and partly cloudy (0–3) now show Clear Skies. Previously they showed rain, or snow if it was cold — there was no clear-sky scene to show, so the code substituted precipitation.
- Fog (45, 48) now shows Fog. It had been mapped to rain despite the Fog mode existing.
- Thunderstorms (95–99) now show the Thunderstorm scene rather than rain with lightning.
- Unknown codes fall back to Clear Skies instead of snow.
Performance
Measured on an Apple M4 with a 6K display, heavy snow at 400 flakes with accumulation and clouds on, both builds running at the display refresh rate:
| CPU | |
|---|---|
| 1.0 | 103% |
| 1.1 | 53% |
| 1.1 capped to 30 fps | 40% |
Fog with 400 wisps dropped from 24% to 20% on top of that.
What changed:
- The physics model is no longer
@Observable. Nothing observed it — redraws come from the timeline — so every property read and write in the frame loop was paying for Observation tracking that had no subscribers. - Snow crystal drawing is batched. A dendrite was 78 separate path allocations and 78 stroke calls per flake per frame; it is now 3 paths and 4 draw calls, with no change in appearance.
- Colours are resolved once per frame instead of once per flake.
- Fog and Aurora stopped rebuilding their gradients inside the draw loops. At 400 wisps fog was allocating roughly 1,600 throwaway colour objects every frame.
- Smaller fixes in the physics loop: splash expiry no longer degrades quadratically under heavy rain, nearest-puddle lookup is a precomputed table rather than a linear scan per raindrop, and the accumulation smoothing pass reuses a buffer.
New in Behavior settings
- Max Frame Rate — 30 / 60 / 120 / display native, defaulting to 60. Weather effects look identical at 60 and 120, so this roughly halves render work on a ProMotion display.
- Hidden overlays suspend entirely. wthrr's overlays sit below normal windows, so they are fully covered most of the time. A covered overlay, or one on a sleeping display, now stops rendering altogether rather than drawing where nobody can see it.
- Performance readout — live FPS and frame-time p50/p99 measured from wthrr's own frames.
os_signpostintervals (frameandphysics, categoryrender) are emitted for use with Instruments. - Adaptive Quality now measures wthrr. It previously sampled system-wide CPU, so it throttled whenever anything else loaded the machine and never when wthrr was itself the expensive process. It now measures wthrr's own CPU share, and also backs off when wthrr misses its own frame budget.
- System Low Power Mode is honoured. wthrr had its own Low Power setting but ignored the one in System Settings.
Under the hood
- Built in Swift 6 language mode, warning-free.
- A unit test target covering the sun's arc, the render budget, seeded RNG determinism, cloud and particle factories, snow crystal geometry, and weather-type persistence.
- Running the test suite no longer fails when a copy of wthrr happens to be open.
Built with Swift 6 and SwiftUI. Requires macOS 26.4+.