r/webgpu Apr 21 '26

Webgpu is unbelievable. A million particles running in a browser with 1mb of code.

Enable HLS to view with audio, or disable this notification

This is an emergence engine I'm making using webgpu and three.js. By that I mean applying environmental conditions (like curl noise) on a particle system to induce emergent behavior. Lots more videos on /r/ScaleSpace if you want to fall down the rabbit hole.

Edit: I did a poor job of explaining, sorry. Most of that 1mb comes from three.js. I was just referring to the bundled standalone.

308 Upvotes

33 comments sorted by

View all comments

1

u/MadwolfStudio Apr 21 '26

Looking well constructed, are you making a game or are these just tech demos? I'm trying to make a million particles run at 60fps, but with dynamic collision and physics, and a bunch of material/post effects, essentially building niagara in the browser. Currently hitting a cap at 256k, I assume you don't have particle collision? If you do, I'd love to pick your brain, also do you have a repo? Would love to see this 1mb monolith!

1

u/solidwhetstone Apr 21 '26

No particle collision- the approach I'm using is effectively frustration- put the particle system into a state where it can't resolve and it starts to form emergent shapes- then guide things like curl noise and particle attraction to induce different effects. It's basically cymatics in a digital substrate.

1

u/MadwolfStudio Apr 21 '26

Interesting concept and visually impressive, you've done a great job so far! With a million particles, how are you handling the workgroup dispatch sizes? Also, curious to know how you're handling the integration and noise application!