..

Homework 1 - Particle System

Jackson Kruger

The source code for this can be found on Github. I developed this particle system in Visual Studio on Windows. A zip of the compiled executable and supporting files can be downloaded here.

Features

Simulations

Water Hose/Cannon

In this simulation water particles come gushing out of a massive pipe. Next to the side of the pipe is a silhouette representing an approximate person's height. This is the only simulation where particles collide with the center-of-gravity sphere, which can be moved with the mouse. Force can still be applied with it for interesting effects. This is the simulation I spent the most time tweaking the behavior of to get it just right.
Video: Water Cannon

"Sunlauncher" Magic Spell

This simulation is of a magic spell that allows you to launch a miniature sun. Upon reaching the ground, this miniature sun explodes into millions of particles. These 'bits of sun' then gradually cool until they disappear altogether. The sun can be launched from the camera's position using the "g" key.
Video: Sunlauncher Magic Spell

Free Mode

This abstract simulation mode shows off the absurd number of particles involved in the system. The particles are attracted a 'center of gravity' point when the user clicks. The force applied when doing so can be scaled with the +/- buttons as described in the program's usage. This was the mode I used while getting the compute shader for the system up and running.

Video: Interesting effects when the particles started with the same z value, 2M particles
Video: An oscillating center of gravity, 8 million particles
Video: Some pretty artifacts when rendering 32 million particles
Video: Particles bumping up against non-bounceable floor, 2M particles
Video: Particles bouncing off of the surrounding bounding box, 2M particles
Something to note with these videos: google's compression doesn't like the chaos of them. If downloaded they should be full original resolution/framerate.

Tools/Libraries Used

This particle system is based on OpenGL (with a GLSL compute shader). SDL is used to interface with windows. SDL_Image is used to load textures. Glad as an interface to OpenGL. All code was written in Visual Studio on Windows.

Challenges Encountered

The main challenge was of course getting the OpenGL compute shader running. Even once it was running, there were a variety of challenges stemming from how massively parallel the compute shader is. All data interfacing (to/from) the compute shader is done through Shader Storage Buffer Objects.

Performance Notes

I did these tests only on my personal system, sporting a GTX 1070, an AMD-FX 8350, a 8GB DDR3 RAM.

Fun Mistakes

A snapshot of the source code used for the checkin can be found on GitHub. Checkin video: Checkin video - bouncing balls