🌈️ apply a wallpaper based on the weather outside
rainwall TODO.md
9.6 kB
Markdown
at main

Single-Color Sky Model β€” Implementation Checklist #

Goal: reuse the physically-based scattering model (Rayleigh + Mie + ozone) but collapse the output down to one RGB value representing the dominant sky color, instead of a full gradient texture.

Phasing note: this checklist is split into a Baseline (single scattering only β€” get a working, correct-looking sky first) and a Later phase (multiple scattering β€” added once the baseline is solid). Multiple scattering is the most complex and error-prone piece of this whole model, so it's deliberately pushed to the end rather than blocking your first working version.


0. Decision to lock in first: what does "dominant color" mean? #

This determines your sampling strategy in Phase 4, so pick one before writing code.

Recommendation: start with Option A for a working baseline, then upgrade to Option B (5–8 samples, luminance-weighted) once the pipeline works β€” it's a small code change and noticeably more robust across sun angles.


BASELINE β€” single scattering only #

1. Port the physical model (reuse, don't reinvent) #

2. Transmittance (Buffer A equivalent) #

3. Sample the sky and integrate single scattering #

4. Tonemap down to a single displayable color #

5. Validate the baseline #


LATER β€” add multiple scattering #

Only start this once the baseline above is working and validated.

6. Multiple scattering estimate (Buffer B equivalent) #

7. Fold it into the raymarch #


Aside: pollution-aware Mie scattering via Open-Meteo #

Open-Meteo's Air Quality API can supply real PM2.5/PM10 to drive the Mie coefficient instead of a fixed haze constant, per the MEE approach discussed earlier. This is independent of the multiple-scattering work above and can be done at any point.