Skip to content

Draw the rain rings as shaded ripples - #326

Draft
fredj wants to merge 1 commit into
masterfrom
rain-rings-ripples
Draft

fredj wants to merge 1 commit into
masterfrom
rain-rings-ripples

Conversation

@fredj

@fredj fredj commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

RainRings drew one thin line per cell, growing linearly, clipped to its cell, in one flat color: painted circles rather than ripples. This replaces the look, so it needs the owner's eye: compare it in the post-process demo (Rain rings) against master.

  • A ring's radius grows with the square root of its age (fast, then slowing); it fades in over its first tenth and out as it grows.
  • Its crest is a Gaussian bump shaded by its slope toward the light along the ground: the side facing the light lighter, the other darker; flat once the sun is below the horizon. color still tints it and sets its strength.
  • Each pixel sums its cell and the neighboring cells a ring can reach it from, so rings cross their cell's edge (the crest capped within a cell); pixels too wide, covered or too steep skip the work.

Tested: npm test, typecheck, build-demos; the post-process demo 4 m above a meadow at noon, toward and away from the sun. Frame time at 1201 x 647: 3.2 ms for the rings, 3.0 ms for the old ones (6.6 ms before the early outs).

Open for the owner: under a sun near the zenith the relief fades (it follows the light's share along the ground), and under Precipitation's overcast the rings are still lit by the sun; shading by the view direction (a wet crest reflecting a brighter sky overhead than toward the horizon) would hold in both. A ring crossing the water's edge changes its pace there (the wetness is the pixel's, not the drop's).

RainRings drew in each cell one thin line growing linearly, clipped to
its cell, in one flat color: painted circles. A ring is now a ripple:
its radius grows with the square root of its age, it fades in over its
first tenth and out as it grows, and its crest, a Gaussian bump, is
shaded by its slope toward the light along the ground, one side lighter
and the other darker, so it reads as relief. Each pixel sums the rings of
its cell and of the neighboring cells a ring can reach it from, so rings
cross their cell's edge; the color option still sets their tone and
strength. Pixels too wide, covered or too steep skip the cells: 3.2 ms
against 3.0 ms at 1201 x 647 near the ground.

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