project thumbnail
Duration 1st: ±4 weeks
Date first: November 2012
Tools used: OpenCL
Visual Studio 2010
Very sleepy

OpenCL particles

This is a hobby project I did in a break from school. I was interested in learning GPGPU so I started a simple OpenCL project.


  • OpenCL point mass particle simulation with C++ fallback.
  • Correct linear physics, and fudged angular physics for speed.
  • Particles collide with world, but not with each other.
  • SAH BVH for world collision model.
  • Stack-less BVH traversal in OpenCL kernel.
  • Gravitational singularity force, acting on all particles.
  • Explosion forces acting on all particles.
  • Distance based LOD calculated with OpenCL.
  • Frustum culling in OpenCL.


OpenCL particles screenshot 1
Frustum culling demonstrated. The colored wire cubes show the frustum bounds.

OpenCL particles screenshot 2
Demonstrating gravity singularity effect. All particles are pulled to the center.

OpenCL particles screenshot 3
Particles settle on the ground without falling through or trembling.

OpenCL particles screenshot 4
Singularity and explosion force next to each other.

OpenCL particles screenshot 5
Complete BVH.

OpenCL particles screenshot 6
Close up on teapot. First 8 layers of the BVH hidden.