Back to browse
GitHub Repository
2 starsRust

BigBangrs – A (simple, but fun) gravity simulator

by felipellrocha·Mar 18, 2026·1 point·0 comments

AI Analysis

●●SolidWizardryRabbit Hole

3 million particles with voxel gravity field, all GPU-driven in Rust.

Strengths
  • Particles deposit mass into voxel grid then sample that field for emergent motion
  • Full compute pipeline built from scratch including buffers, bind groups, dispatch
  • Voxel gravity field can be visualized directly by rendering the grid
Weaknesses
  • Explicitly a learning project, not physically accurate or conservation-law compliant
  • Performance bottlenecks unclear even to author on M1 hardware
Category
Target Audience

Graphics programmers learning GPU compute pipelines

Similar To

NVIDIA Flex · Unity DOTS · Taichi Lang

Post Description

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 :)

Similar Projects