garage44.eu/jeroen/cartopolis

logclone: git clone https://garage44.eu/jeroen/cartopolis.git

.. /docs/adr/032-global-cloud-cover-data.md

raw

ADR-032: Global Cloud Cover from GFS (Real Weather Driving Procedural Clouds)


Metadata:


Context

Problem: The globe/space-tier cloud layer (shaders/globe_clouds.wgsl) is procedurally generated — latitude banding + domain-warped noise — and its overall cloudiness was initially wired to the ground weather slider (dev.cloud_cover, the met.no reading at the single map anchor). One town's 89% cover overcast the whole planet, which is wrong: the globe should reflect global weather. That coupling has been removed (the layer now holds a fixed GLOBE_CLOUD_COVER baseline), leaving the globe realistic-looking but not tied to today's actual weather. We want the cloud positions on the globe to match reality without turning the layer into a pasted satellite photo.

Requirements:

Decision

Drive the globe cloud layer's coverage from NOAA GFS Total Cloud Cover (TCDC), fetched directly from NOMADS, decoded in pure Rust, and uploaded as one small equirectangular data texture the shader samples as its coverage field.

Approach:

Rationale

Primary Reasoning:

  1. TCDC is a scalar coverage field, not imagery — it modulates the procedural clouds instead of being displayed, so the clouds stay synthetic (shape, swirl, motion) while their placement becomes real. Coarse resolution is sufficient and desirable (the noise fills sub-grid detail).
  2. GFS is US-government public domain — no key, no attribution, freely redistributable — the lowest-friction option and a natural fit for the project's self-hosted, Rust-only posture.
  3. One small periodic fetch + one small texture upload is well within the device-loss/churn budget; it adds no per-frame streaming.
  4. Reuses the established live-data pattern (met.no weather, OVapi transit).

Alternatives Considered:

AlternativeProsConsRejected Because
Open-Meteo API (JSON cloud_cover)Clean JSON, no GRIB decodeFree tier non-commercial + rate-limited; CC-BY; solo-maintainer bus factorSame underlying GFS/ICON data with licensing/rate strings; direct GFS avoids them (self-host Open-Meteo remains a fallback)
NASA GIBS satellite imageryLiterally today's cloudsHigh-res RGB picture; daily snapshot, polar-orbit seams; hard to animateViolates "no picture / keep it procedural"; static
ECMWF / DWD ICON open dataBest model qualityGRIB2 too; ECMWF CC-BY, DWD attributionGood future swap; GFS chosen first for public-domain + simplest access
Keep fixed GLOBE_CLOUD_COVERZero depsNot real weatherDoesn't meet the "match reality" goal; kept as the fallback path

Consequences

Positive:

Negative:

Related