WebGPU - Compute shader experiments

Been having some fun with compute shaders since WebGPU shipped with Chrome stable and have made a few demos/projects.

2D/3D Boids - WebGPU Boids
The slider is exponential so you can get up to 67 million Boids in 2d at 30fps if you have a powerful GPU.

nBody Galaxy Simulation - WebGPU nBody
CPU struggles with more than 3000 bodies, but GPU can handle 30000+ easily.

Game Of Life - WebGPU GameOfLife
There’s a toggle to compare the CPU and GPU performance and then a button to really show what the GPU can do

11 Likes

The boids are mind blowing!! :heart_eyes:

1 Like

Great demos!

Pretty cool !!! cc @PirateJC

1 Like

How did you achieve this 2D mode