Recently, I’ve been experimenting with shaders and programming the GPU. Some time ago, I built a particle system that operated on Perlin noise and Newtonian physics, and I’ve always wanted to push that particle system further. The first iteration of that project involved a particle system that was purely based of visualizing Simplex Noise (a derivative of Perlin noise). I called it Swarm.
However, I was always severely constrained by the resource consumption of the old particle system. Due to a mixture of reasons, including my inefficient code and the complexity of the Simplex Noise algorithm, Swarm simply could not run at acceptable framerates with high particle counts. For example on my laptop, when the number of particles went higher than a few thousand, the framerates would often slow to the single digits. This constraint affected the resultant String Theory project as well.
However, I soon realized that a particle system implemented completely on the GPU with shaders would be able to surmount this problem. With this project, I was able to replicate the aesthetics and functionality of the original Swarm project, this time with 800,000 particles. That’s 3 orders of magnitude more particles running at an average of 60 FPS!
Below is a video recording of the particle system in action. The framerate is slower during recording due to the added overhead of the recording software. Looking forward to implementing the physics on the GPU!
Made with ♥ using OpenFrameworks
Project can be found on Github here