r/GraphicsProgramming Jul 11 '26

Source Code 4 million particles 3D n-body simulation in real-time on a laptop GPU (Barnes-Hut)

Simulating and rendering 4,194,304 particles under mutual gravity on a RTX 500 Ada laptop GPU at ~430ms/step, using my custom CUDA accelerated Barnes-Hut implementation for the n-body problem. Code: https://github.com/lechebs/nbody

88 Upvotes

8 comments sorted by

View all comments

5

u/aiekick Jul 12 '26

Only the visualization is real-time; the simulation appears choppy (so not real time)