Skip navigation
Ok, I've decided to implement Particle Life simulation on GPU, using WebGPU, in browser.
0:00 / 0:20

Ok, I've decided to implement Particle Life simulation on GPU, using WebGPU, in browser.

Nikita Lisitsa

@lisyarus13K followers

Visit on X
207 likesDownloadOriginal post

16,249 views

Ok, I've decided to implement Particle Life simulation on GPU, using WebGPU, in browser. For now I've spawned 1'000'000 particles and implemented basic rendering & camera movement. I recon computing interaction forces will be the most painful part to implement...

12 Comments

Comments from the original post on X (Twitter)

  • Guillaume Boissé's profile picture

    @guitio2002

    I described my spatial partitioning data structure for particles in here, maybe useful? Different use case though arguably, an important bit for me was for the particles to be able to flow anywhere (hence the spatial hash).

    2 likes

  • Nikita Lisitsa's profile picture

    @lisyarus

    Thanks, I'll check it out! In my case a fixed bbox is better, so having fixed bins is probably fine

    1 like

  • Page to Pixel Publishing's profile picture

    @pagetopixel

    The Art of Flight is a homage to 80s/90s arcade action shmups with a fresh twist on the genre. Pilot multiple ships at the same time to take on oncoming waves of enemies in this fast paced space shooter. Wishlist on Steam today!

    2,039 likes

  • i love fish's profile picture

    @BonisDev

    my web gpu implementation for particle life for 6k particles, but the collision is done bruteforce so 6000x6000 comparisons at 60fps, any more and it will lag :( i cant wait to see how you tackle this problem

    2 likes

  • jairoandre's profile picture

    @jairoandre

    I did something similar using compute shaders... With 50k particles my RX 6600 vga card suffers a little.

    1 like

  • Nick Gimbal's profile picture

    @GimbalNick

    very dope - you should wrap the edges so it feels infinite

    1 like

  • AFX's profile picture

    @AFX_LAB

    Use a spatial grid

  • Nikita Lisitsa's profile picture

    @lisyarus

    Yes, that's what I'm planning to do

  • Adam's profile picture

    @0xbuild__

    Barnes-Hut would be useful on this scale for approximation of forces -

  • Nikita Lisitsa's profile picture

    @lisyarus

    I don't need to approximate forces, they have limited distance anyway. And building quad trees on GPU is rather hard

    1 like

  • Peter McNeeley's profile picture

    @petermcneeley84

    You are likely to run into precision issues with f32. You can try to avoid this with integer grid + offset positioning.

  • Nikita Lisitsa's profile picture

    @lisyarus

    With the current world size I still have a precision of about 0.001 times the size of a particle, so I doubt this will be a problem