Settings

Theme

Show HN: BigBangrs – A (simple, but fun) gravity simulator

github.com

1 points by felipellrocha 2 days ago · 0 comments · 2 min read

Reader

https://github.com/felipellrocha/bigbangrs

I built a GPU “big bang” particle sim in Rust (wgpu) over a 2-day sprint

I’ve spent a lot of time working on web engines, but had never really touched modern GPU compute directly, so I used this as an excuse to dive in and learn.

What it does:

- ~3 million particles simulated in real time - Interactive framerates (hardware-dependent) - Voxel-based “gravity” field that particles both write to and read from - Fully GPU-driven (compute + rendering)

The basic idea: Particles deposit “mass” into a voxel grid → the grid gets blurred over time → particles sample that field to derive a force → that drives motion.

It’s not physically accurate, but it produces some really interesting emergent structure.

What surprised me: I tapped out at a relatively low particle count.

I’ve pushed GPUs much harder on the web before (tens of millions of grass blades in one of my games), so I expected to go further here. Not sure where the bottleneck is:

- WebGPU vs Metal vs wgpu - Something dumb in my pipeline - Or maybe I’m accidentally hitting a software fallback somewhere

I’m on an M1, so I’d expect this to scale better on something like an RTX 30xx+. The project seems almost entirely GPU-bound, but I wouldn’t be shocked if I’m wrong.

What it’s not:

- No collisions - Not real gravity - No conservation laws - I’m not a physicist, and it shows

This is much more of a visual / emergent system than a real simulation.

Context: I wrote the compute + rendering + simulation logic myself. Used AI to scaffold some surrounding pieces (including this post). This was mostly about learning how to actually use compute, not just read about it.

Thanks: Huge shoutout to the Rust and wgpu teams. The fact that this is even approachable is kind of wild.

If you’re interested, check it out / break it / improve it. PRs welcome — I’ll review and merge anything solid.

Happy to answer questions or get roasted for the physics :)

No comments yet.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection