Home

The Ghost in the Swarm

A hundred thousand particles on your GPU, each following one simple rule, plus a hidden field I added that pushes the whole swarm into shapes.

initializing…
drag to stir · shift+drag to push
Controls
Force Matrix

Row attracts column. Green = attract, red = repel. Click a cell to cycle. Shift-click to randomize one cell.

Rogue field

A hidden flow that slowly cycles through patterns and steers the whole swarm.

2.0
1.0×
Physics
30k
32
1.00
0.55
0.30
4.0
8
Your saves

Save the current setup to a slot; click a filled slot to load it. Hold a slot (or right-click) to delete. Slots persist in your browser.

There are two things going on here. The dots are Particle Life: a hundred thousand of them on your GPU, each following one rule about which colors to chase and which to run from. That rule by itself is enough to grow cells, chains, and blobs that move like they're alive. The second thing is the part I added, the ghost.

A starling murmuration at dusk: thousands of birds massed into a single dense, flowing shape over a field.
A starling murmuration. Thousands of birds, no leader, each minding only its nearest neighbors, and out of that comes one shape that folds and pours across the sky. The same trick as the swarm above. Photo by Walter Baxter, CC BY-SA 2.0.
The part that's mine

An invisible hand

Watch for a bit and you'll see the whole swarm settle into a shape, hold it, then melt and form the next one. That's a hidden flow field I laid over the simulation. It keeps cycling through patterns, spirals, mandalas, that sort of thing, like an old Winamp visualizer drifting from one scene to the next.

The trick is that each pattern pushes the particles along its lines instead of straight at them (a curl field). So the swarm flows around the shape and keeps doing its own thing while it traces it, instead of all clumping into a few dots.

Builds on Ventrella's Clusters, Tom Mohr's Particle Life, and lisyarus's WebGPU port; the ghost is the piece I added. Source: particle-life.js.