- NVIDIA GPU compatible with CUDA
- The Cuda toolkit
- CMake
- Visual studio
mkdir build && cd build
cmake ..
Open the project collisions.sln
with Visual Studio and execute it there.
These are the available arguments you can use:
-v 1
CPU Parallel grid collision detection algorithm (OpenMP)-v 2
GPU Parallel grid collision detection algorithm (Cuda)
In some cases, the CPU version might be better than the GPU one (Not my case, AMD FX-6300 and GTX 960).
-t 0.02
The smaller the higher the precision but slower the simulation.
-s 15.0
Particles would have radius from 1 to 15 pixels.
-b 10
This would make a uniform grid of 10 x 10 buckets/cells.
-c 1000
The maximum number of particles that can be in a bucket.
.\collisions.exe -n 40000 -b 100 -c 5000 -s 5.0 -t 0.02