Files
sunrise/docs/superpowers/plans/2026-10-30-precipitation.md

17 lines
2.0 KiB
Markdown

# Rain and snow
User requested actual falling rain and snow with intensity driven by the selected time's weather. Extend the existing weather controller and Three.js world without dependencies. Use rain plus showers in forecast/history and rain in reanalysis; snowfall remains cm. Accumulations represent the preceding hour, unlike interpolated cloud/visibility. Missing amounts stay unknown and produce no particles.
Implementation: bounded camera-local rain line segments and soft snow points; animate only active precipitation, scale density and rain streak strength with amount, preserve scene depth, clip at the sampled terrain/sea surface. Reuse weather transitions and render invalidation. No accumulation, surface wetness, measured wind, or roof collisions.
- [x] Extend weather request/parser/sampling and focused tests.
- [x] Add precipitation constants and renderer, connect active camera/update/disposal.
- [x] Show hourly rain/snow amounts, update documentation.
- [x] Run focused/full tests, build, and browser rain/snow/mixed/dry checks.
No Git metadata exists in this workspace. Work in place, preserving unrelated edits.
Verification: all 79 tests pass, including the localhost HTTP test when run with network access. Production build passes with the existing chunk-size warning. Actual forecast, historical forecast and reanalysis requests returned HTTP 200 with rain in mm and snow in cm. Review identified transient false mixed precipitation when switching types; absent types now stop immediately while positive intensities ease in.
Browser verification with controlled API responses: heavy rain (15 mm/h, 3,535 streaks), light rain (0.2 mm/h, 408 streaks), snow (2 cm/h, 1,555 flakes), mixed rain/snow, dry, and unavailable precipitation all passed without page or WebGL console errors. The rain-to-snow assertion reproduced the review finding before the fix and passed afterward. Screenshots and the reusable local QA runner are in `.tmp/`. UI dates were frozen at noon KST; API fixtures are test data, not actual weather claims.