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.
- Dynamic number of agents (In WebGPU buffers/textures cannot be resized).
- Multiple Species and Evolution.
- Control agents using image/video bitmasks.
- I first came across this through Sebastian Lague's YouTube channel
- Sage Jenson's excellent webpage
- The underlying research paper