Skip to content

cloud_sky: evolving coverage (a Dobashi cellular automaton) and orographic clouds - #1033

Merged
transfix merged 4 commits into
masterfrom
feat/cloud-coverage-ca
Nov 7, 2026
Merged

transfix merged 4 commits into
masterfrom
feat/cloud-coverage-ca

Conversation

@transfix

@transfix transfix commented Nov 6, 2026

Copy link
Copy Markdown
Owner

LSYSTEM-LABORATORY-ROADMAP §4.7: cloud_sky's coverage evolves over time, and orographic coupling gathers it on windward flanks. This was the last open cloud item in GENERATED-WORLD-ROADMAP.

What changes

cvc::world::cloud_layer (GL-free)

  • A Dobashi-style cellular automaton runs over the deck's cells.
    • Each cell has one bit-packed uint32 column of 32 layers, with Dobashi's humidity, activation and cloud bits.
    • Activation spreads up and down the whole column, and with a small probability (0.03) to the same layer of the four neighbouring cells.
    • Cloud bits go extinct at random and humidity comes back, so clouds grow in patches, last some 100 steps and dissipate.
    • Random bits come from a hashed splitmix stream per (seed, step, cell), so a run is deterministic.
  • The cells with the most cloud bits hold the deck's clouds, exactly round(coverage * cells) as before. A held cloud gets a 0.1 lead in the ranking (hysteresis).
  • evolve(dt, rate) steps on the caller's clock: one step every evolve_s (5 s) at rate 1. Each cell's presence moves toward its target over fade_s (20 s), with the fade split at the steps, so one call of 10 s gives the same deck as a hundred calls of 0.1 s.
  • add_shadow and add_far weight each cell by weight() (a smoothstep of presence). The renderer gives the near volume the same weight, so the shade and the far slices match the volumes through a fade.
  • Orography: set_ground(heights, rows, cols, x0, y0, dx, dy) keeps a box-averaged copy of the ground.
    • forcing(x, y) is the slope along the wind (wind_az), averaged over nine points of a cloud's footprint and divided by 0.1, in [-1, 1].
    • A cell over a windward flank gets more humidity (x(1+3s)) and activation (x(1+10s)); a cell in the lee loses its cloud faster (x(1+3s)), where s is the orographic strength.
    • set_drift places the cells over the ground, so a cloud forms as the wind brings it to a mountain and dies past the crest.
  • A new layout (set_area) starts the automaton over and runs it 200 steps (warm), so a new deck has already settled.

cloud_sky realizer

  • New props: wind_az (the drift now follows it; 90 = +x, as before), evolve, orographic, fade.
  • New live keys under the node's root: sky.evolve and sky.orographic, also on sky_controls.ari (Weather speed, Orographic).
  • The ground's height field is given to the layer at realize time, and again when it is regenerated (its sample array changes).
  • A near volume's opacity is its near/far crossfade times its cloud's weight. Clouds still fading out stay eligible for a near volume.

Docs: ARIADNE.md (cloud_sky keys), INDEX.ari binds, terrain_lab.ari (explicit wind_az / evolve / orographic), both roadmaps.

Measured / tested

  • world_cloud_test: 15/15 (7 new):
    • coverage holds its count while 82 of 441 cells change in 30 steps;
    • frame-split independence and determinism;
    • a half-faded cloud's shadow and far slices are exactly its full cloud's times its weight;
    • rate 0 freezes the automaton but finishes the fades;
    • forcing = slope along the wind (sign flips with the wind, 0 off the ground, saturates);
    • over ridges, windward cells hold a cloud 99% of the time and lee cells 14%; without the coupling, 60% / 61%;
    • a step over 64x64 cells takes 0.7-0.9 ms (Release, this Windows box).
  • cvcgl_ariadne_realize passes, including the new seeded storm.evolve / storm.orographic check. ariadne_loader_test component tests pass.
  • arigl snapshots of terrain_lab.ari at 1.2 km and 11.2 km over time (below).

Not done / notes

  • The deck is one flat slab (base 300 m in terrain_lab, relief 90 m), so a peak pierces it only where the ground rises past base. A lower deck or ground-following bases would show orographic caps there. This is noted in GENERATED-WORLD-ROADMAP.
  • Not measured in a browser. The change is CPU-side and adds no shader code: only cloudXf.y now carries the wind's y drift.

Snapshots

Taken with arigl on Windows from the cvcpkg prefix. A scratch copy of terrain_lab.ari set the camera from on_tick. The world clock runs 1/30 s a frame in a snapshot, so 600 frames are 20 s of world time; sky.evolve=30 makes that about 120 weather steps, some 10 minutes at the default rate.

  • 1.2 km, low camera, t0 vs 20 s at 30x: the near cloud on the left dissolves, the big one is replaced, and the shells rearrange.
  • 11.2 km, mid camera, t0 vs 20 s at 30x: new clouds appear with their shade, some are mid-fade, others are gone.
  • 11.2 km, drift held, orographic 0 vs 2: at 2 the windward cells keep the t0 layout; at 0 more cells turn over.

The images are kept locally with the session's notes; they can be re-made with the commands above.

Seen in passing and present before this change too: the far shells still band into horizontal streaks seen from about 6° elevation.

…aphic clouds

cvc::world::cloud_layer runs a bit-packed cellular automaton over the deck's
cells (one 32-layer column each: humidity, activation, cloud). Activation runs
up a column and, by chance, into the four neighbours; clouds go extinct and
humidity returns, so clouds grow in patches and dissipate. The cells with the
most cloud hold the deck's clouds, still exactly `coverage` of them, and fade
in and out over 20 s; the shadow and far slices take the same weight as the
near volumes. evolve() steps on the world clock, frame-rate independent.

Orographic coupling: the slope along the wind under each cell raises its
humidity and activation on a windward flank and its extinction in the lee.

cloud_sky: wind_az / evolve / orographic / fade props, sky.evolve and
sky.orographic live keys (sky_controls.ari), the ground's relief given to the
layer. Tests in world_cloud_test; docs and both roadmaps updated.
# Conflicts:
#	docs/roadmap/GENERATED-WORLD-ROADMAP.md
#	src/cvcGL/ariadne/lsystem_nodes.cpp
@transfix
transfix enabled auto-merge (squash) November 7, 2026 00:02
@transfix
transfix merged commit 352f193 into master Nov 7, 2026
16 of 27 checks passed
@transfix
transfix deleted the feat/cloud-coverage-ca branch November 7, 2026 00:13
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