262,144 agents wander a 2D surface, each sensing pheromone concentration at three points ahead: left, center, and right, offset by a sensor angle and sensor distance. This three-sensor arrangement creates chemotaxis. Each agent compares the three readings, turns toward the strongest signal, steps forward, and deposits its own trail. A diffusion pass blurs and decays the trail each frame.
The algorithm was proposed by Jeff Jones (2010) to model the transport networks of Physarum polycephalum, a slime mold that solves shortest-path and network-optimization problems without centralized control. The model captures the essential feedback loop: agents reinforce paths they travel, and reinforced paths attract more agents.
Sensor distance and sensor angle are the most sensitive parameters. Large sensor distance makes agents responsive to distant pheromone gradients, producing sparse, highway-like networks. Small sensor distance creates dense, capillary-like meshes. The diffusion kernel size controls branch thickness: a wider blur lets trails spread further before decaying, resulting in thicker veins. Decay rate determines how long abandoned paths persist.
Agent state lives in a float texture, updated per-frame by a fragment shader. Deposits scatter via GL_POINTSinto the trail framebuffer. The result is entirely emergent: no agent knows about any other, yet they self-organize into branching vascular networks. Your cursor warps the agents' turn bias, pulling the network toward you. Watch for the network adapting in real time as it reroutes around your input.
Sage Jenson · Wikipedia