Your browser or graphics card does not seem to support WebGL

Rules

Same GPU pipeline, different velocity shader

Emergence

Two emergent systems running on one GPGPU pipeline in three.js. Position and velocity live in ping-pong float textures on the GPU; switching mode swaps only the velocity rules. Flocking runs the classic boids rules — separation, alignment and cohesion — over an O(n²) neighbour search in a fragment shader, and flees the cursor. The flow field advects particles through divergence-free curl noise and is drawn toward the cursor instead. Part of Pedro Brás' collection of interactive WebGL experiments.