Skip to content

Shape the clouds from a coarser map, and add fair-weather cumulus - #327

Open
fredj wants to merge 2 commits into
masterfrom
clouds-tower-walls
Open

fredj wants to merge 2 commits into
masterfrom
clouds-tower-walls

Conversation

@fredj

@fredj fredj commented Nov 19, 2026

Copy link
Copy Markdown
Member

The clouds were the radar's footprint extruded upward: decks shaped like the map, towers standing as walls with stepped outlines, and every view from below an overcast, since a radar sees only rain clouds. They need not stand exactly where the radar saw the rain, only look like clouds.

  • A coarser map (cloud-map.js, in the worker): the shield and the type softened (the type dilated round first, so a small cell keeps its height: a tower's top is a dome) and warped by up to 2.5 km by an 8 km noise, so no radar outline survives; the rain itself stays where the radar saw it, under Precipitation's shafts and Lightning. Over dry ground and light rain the coverage varies by an 8 km and a 2 km noise: the shield breaks into clouds with gaps, the heaviest rain still under closed cloud.
  • Fair-weather cumulus (fairWeather, 0 by default, 0.3 in the weather demo): over the dry ground, the bright separate puffs with clear sky between them a radar never sees, blending into the rain's shield. The march's and the shadow map's probes count them; a ray that meets no shield takes half the fine steps.

Tested: npm test, typecheck, build, build-demos; the weather demo at 2026-11-13 12 UTC (scattered showers), seven views against master and against frames of a game's cloud footage. Contrast (luminance deviation) over dry ground away from the sun 58 (the reference 64; master has no clouds there), level over the plains 51 against 30, from above 48 against 37. Clouds' GPU time at 1916 x 794: over dry ground 4.1 to 7.7 ms, from 12 km above 4.9 to 9.7 ms; views under the rain alone unchanged. The map takes about 0.3 s in the worker (85 ms before).

Not done, left for follow-ups: toward the sun the cumulus wash out to white rather than showing dark bases and bright edges (lighting); the largest towers keep steep sides; from under a heavy-rain deck the contrast is lower than master's (27 against 39). Known limits: dilateRound keeps a copy of the map per pixel of its radius, fine at 1 km, heavy for a much finer map; a narrow shower falling between two of a ray's 8 probes is drawn with the cumulus' coarser steps.

The clouds were the radar's footprint extruded and eroded: their sides
followed the coverage's outline, and the type set each 1 km pixel's
column to its own height, so towers stood as walls with stepped
outlines. The clouds need not stand exactly where the radar saw the
rain, only look like clouds, so the map now gives regions, as Nubis' low
frequency weather map, and the noise shapes them:

- the shield softened over 3.5 km after its 5 km spread, full where it
  rains; the type dilated round over 4 km and softened over 2.5 km: a
  tower's top is a dome, and a small cell keeps its height
- the shield and the type resampled warped by up to 2.5 km by an 8 km
  noise, in the worker, so that no outline of the radar's survives and
  the clouds, the max map and the shadow map read the same map; the rain
  stays where the radar saw it, where Precipitation and Lightning draw it
- over dry ground and light rain, the coverage varied by an 8 km and a
  2 km noise, read once: the shield breaks into clouds with gaps between
  them, the heaviest rain falling from closed cloud

The map takes about 0.3 s in the worker, against 85 ms.
The clouds came only from the radar's rain, so every cloud was a rain
cloud, a gray deck or a tower, and every view from below an overcast. A
radar does not see the fair-weather cumulus of a day without rain, the
bright, separate puffs with dark flat bases and clear sky between them.
The `fairWeather` option, 0 by default, is their coverage over the dry
ground: columns as deep as the thinnest deck, puffy as a tower, gathered
in fields by the map's coverage noise, none where it is low, blending
into the rain's shield and carved by the same billows. The march's and
the shadow map's probes count them, and a ray that meets no shield
takes half the fine steps. The weather demo sets 0.3.

At 1916 x 794 the clouds take 7.9 ms over dry ground (4.1 without),
9.4 ms from 12 km above (4.9); views over the rain alone do not change.
@fredj
fredj marked this pull request as ready for review November 19, 2026 21:53

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant