dorkhub

slime-sim-webgpu

🦠 Slime mold simulation with WebGPU and TypeScript.

SuboptimalEng
TypeScript16710 forksupdated 1 year ago
visit the demogit clone https://github.com/SuboptimalEng/slime-sim-webgpu.gitSuboptimalEng/slime-sim-webgpu

🦠 Slime Sim WebGPU

I made this slime mold simulation to learn more about WebGPU and compute shaders. It's essentially a recreation of Sebastian Lague's coding adventure (albiet with fewer features).

Here's a 45-second demo on Twitter, Threads, and r/GraphicsProgramming. You can also try the playable demo on my website (linked in the about section of this repo). Just know that WebGPU doesn't work on all devices so you might get an error screen.

If you prefer a more in-depth video, you can checkout this 5-minute devlog on YouTube where I showcase an extended demo and answer the following questions:

  • What is WebGPU?
  • What are compute shaders?
  • What is the graphics pipeline for this slime simulation?
  • What happens in each shader pass?

Setup Guide

# Setup Guide (for everyone).
git clone https://github.com/SuboptimalEng/slime-sim-webgpu.git
cd slime-sim-webgpu
npm install
npm run dev

# How to Deploy to GitHub Pages (mainly for me).
# First, go to main.tsx file and enable StrictMode.
npm run build
npm run deploy
# Disable StrictMode before running locally and pushing to GitHub.

Screenshots

Resources

WebGPU

Slime Mold Simulation

License

Shield: CC BY-NC-SA 4.0

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

CC BY-NC-SA 4.0

more like this

urge

The Universal Ruby Game Engine (URGE) Project

C++50

WebGPU-Lab

Demos and experiments in WebGPU technology. Focus on compute shaders.

TypeScript50

aperture

WebGPU-only, ECS-native 3D runtime where simulation is authoritative and rendering is a derived view.

TypeScript53

search

search projects, people, and tags