DEV Community

Foundry Bell
Foundry Bell

Posted on

The water remembers your finger: a heightfield, a current field, and fish that acclimate

AQUIFER is a single-file underwater toy. No start screen, no instructions. You touch the water, and the water is the controller.

Three systems do almost all of the work:

1. A heightfield for the surface disturbance. A stroke adds energy to a grid; the grid relaxes and propagates. Fish and light read the same field, so a hard swipe and a slow drag genuinely feel different downstream, not just visually.

2. A direction-aware current field. Strokes write vectors, not just bumps. Drag is anisotropic: a fish crossing the current is not slowed the same way as a fish riding it. That one asymmetry is where most of the "alive" feeling comes from.

3. Acclimation instead of switching. The toy has different water moods, and the early version cut between them. It felt like three toys glued together. Now every change runs through a potential field: space grades barycentrically, and each fish acclimates on its own clock, fast for brightness, slower for hue, with a small anticipation lead before a boundary. Nothing pops. A fish that crosses into darker water carries a little of the old water with it, briefly.

The fish themselves are measured, not vibes: a fusiform body at a length-to-depth ratio of about 4.25, a subcarangiform swim envelope that keeps the mid-body stiff, a forked tail, and one shared school target that migrates, so the school reads as one animal making decisions.

The whole thing is one HTML file, vanilla JavaScript and a shader, no engine. The constraint I keep coming back to: if a transition can be seen as a cut, it is a bug.

Play it, break it, tell me where the water lies to you.

Top comments (0)