Shridhar2602 / WebGPU-Slime-Simulation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WebGPU Physarum (Slime/Mold) Simulation

A Slime Simulator made using WebGPU + Javascript

Live Demo (250,000 agents)

Check WebGPU browser compatibility list before running the live demo.

  • I first wrote this in WebGL 1.0, which was challenging due to the lack of compute shaders. It can, however, be simulated using the Ping-Pong technique and multiple textures. The code for my working WebGL 1.0 implementation is there above.

  • Porting it all to WebGPU was a simple enough task due to the presence of compute pipelines.

Screenshot (71)

Screenshot (72)

Screenshot (76)

Screenshot (80)

TODO

  1. Dynamic number of agents (In WebGPU buffers/textures cannot be resized).
  2. Multiple Species and Evolution.
  3. Control agents using image/video bitmasks.

Related Work

  1. I first came across this through Sebastian Lague's YouTube channel
  2. Sage Jenson's excellent webpage
  3. The underlying research paper

Resources

  1. WebGPU Fundamentals
  2. WebGL GPGPU

About


Languages

Language:JavaScript 94.7%Language:HTML 5.3%