Skip to content

Latest commit

 

History

22 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mycelia

A GPU slime-mold simulation, in your browser. Hundreds of thousands of agents leave trails, sense them, and self-organize into living, branching networks that flow toward your cursor. WebGL2 GPGPU, no server, no dependencies, no build step.

→ Live: https://mycelia.agentpostmortem.com

What it is

A Physarum (slime mold) simulation. Each of ~262,000 agents senses the trail field ahead, ahead-left, and ahead-right, steers toward the strongest, moves forward, and deposits a little trail of its own. The trail diffuses and decays. From those three local rules, emergent transport networks appear that look uncannily alive.

How it works — four GPU passes per frame

  1. Update agents. A fragment shader reads each agent's state (position, heading) and the trail, senses three directions, steers, moves, and wraps. Agent state lives in a floating-point texture (ping-ponged A/B).
  2. Deposit. One GL point per agent, additively blended into the trail map.
  3. Diffuse + decay. A 3×3 blur times a decay factor, ping-ponged.
  4. Render. Trail intensity is mapped through an Inigo Quilez cosine palette to the screen.

All state lives in GPU textures — there is no CPU in the loop. This is agent-based GPU compute done the WebGL2 way (fragment-shader GPGPU), so it runs anywhere WebGL2 does, and it costs nothing to host because the work happens on the visitor's GPU.

Controls

  • Palette — Spore / Ice / Ember / Bloom
  • Behaviour — Weave / Coral / Storm (different sensor geometry produces different network patterns)
  • Reset, and Save PNG to grab any frame as a wallpaper

Run locally

Open public/index.html in a browser, or serve the folder:

npx serve public

License

MIT

About

A GPU slime-mold (Physarum) simulation in the browser — 262k agents grow living networks and flow toward your cursor. WebGL2 GPGPU, no server.

Topics

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages