Note: This is an older post and the gravity simulation code has since been updated. See here for the latest.
This post did have a bunch of benchmarks and times that were incorrect and have been removed. I was not comparing every particle to every other particle in the gravity calculations.
What is left of this post is still correct. The object counts are correct and there are millions of particles being shown. It is just the actual gravity calculations that were not complete.
Previous Results
Since I originally posted the following 3D gravity movies to YouTube…
…there were questions and some skepticism in the comments so hopefully this blog post helps clarify things. That skepticism about how I could possibly calculate these millions of objects at once was well founded.
Latest Results
Here is a movie with 3,000,000 particles.
Unfortunately YouTube’s compression ruined the movie quality a bit. Mostly due to the noisy/static like nature of the millions of particles. Not enough I frames and too many P frames. Here are a series of screenshots showing what the frames looked like before the compression.
To push it further, here is a rotating disk of 5,000,000 objects.
Again, here are some uncompressed screenshots.
Try It Yourself
If use Windows you can download Visions of Chaos and see the simulations run yourself. Here are a few quick steps to get you going;
1. Open Visions of Chaos
2. Select Mode->Gravity->3D Gravity to change into the 3D Gravity mode
3. The 3D Gravity Settings dialog will appear
4. Change the number of objects to 1,000,000
5. Change the Time step to 0.02
6. Change the Size of objects to 0.2
7. Check Create AVI frames if you want to create an AVI movie from the simulation
8. Click OK
Make sure you have the latest video card drivers so the OpenCL code runs as optimal as possible. For NVidia go here and for AMD go here.
Jason.