Swarm

After leaving RIT I wanted to learn something new to keep me going. That something new would turn out to be C++. Learning the language was a unique process, as I relied on Visual Studio's complaints and errors to tell me what I was doing wrong, and then searching for the answer online; this, opposed to learning the language online in the first place. I knew that I wanted to in a way replicate something that I did in Processing, but in actual OpenGL using GLUT and GLEW.

I decided to recreate the Swarm sketch, since the one on my page is really just the combination of the efforts of two other OpenProcessing members. This time, though I worked out the gravitation algorithm(mine turned out to be faster than the original), the rendering algorithms, and data storage all on my own. Yipee!

The project is essentially just a particle simulator. It keeps track of a bunch of 2D coordinates I've dubbed "flies" and each frame updates their locations and stores their previous ones. We draw a line from current to previous location, and then do a whole bunch of mumbo-jumbo to make it look nice.

The main functionality that the project provides is that when you click on the window, the flies rush to that point, building up momentum along the way, so that when you release the mouse, they fly rapidly about. It looks pretty.

The "mumbo jumbo" that I refer to is actually just a long string of framebuffers. Let me walk you through the process.

First pass
Into a first framebuffer we render the flies. This is the only stage that the actual geometry of the flies is rendered. At each other step we take the render-texture of the previous framebuffer and into another framebuffer plot the texture onto a fullscreen quad. This allows us to manipulate the data of the previous pass in a manner that allows for manipulation of more than just the current fragment, since when sampling a texture we can access whatever texel we want.

First Gauss pass
Next we render the contents of that framebuffer into a second one, performing the horizontal component of Gaussian blurring along the way.

Second Gauss pass
Gaussian blurring is a two step process. We render the X-blurred framebuffer into another one, this time blurring along the Y axis.

Chromatic Abberation pass
Now that we've completed the Gaussian blur, we take the texture and stretch its color channels so that at the edges of the screen, we see some chromatic abberation.

Chromatic Abberation pass
At this point, we render into another framebuffer the combination of the original pass and the fully blurred and abberated pass, mirroring the product in all four quadrants. This makes the particles look more tangible, and less like an aura.

Afterwards, we render that pass into one of six final framebuffers. By combining all six, we average the previous six frames, creating motion blur with a .1 second exposure time. We render that product to the screen as our final display, seen here.

Arcade UI LUMA Swarm Cave Escape ASCIIGL Genny Mods Fan Rail Return...