All   Archive   Code   News   Projects  

 

My name is Stephen Schieberl. I live in the woods near Portland, Oregon. Hit me up to work together.

Ban the Rewind?

A D M I N

Pictured: 10,000 particles expanding A recent batch of projects at Fashionbuddha have called for a brush or particle system. I've followed more or less the same guidelines for creating an emitter for years now. There really isn't much deviation in the basics of building one of these. However, I wanted to explore ways to improve upon the classic particle emitter in performance, quantity, and aesthetic. I've assembled a collection of videos and binaries leading up to my goals. The finished products are in the client work which I can't show here yet. These are more "sketches" than anything, but I figured would be worth sharing as it can be fun to follow the process. Along with each video, you'll find a description and a link to the binary to try out for yourself (Windows only). The programs are sometimes toned down a bit from what's in the video to accommodate less capable machines. All videos represent at least interactive frame rates -- I usually get 60fps while the videos are 30fps. For all applications, press "F" to toggle fullscreen mode, "SPACE" to save a screenshot, and "ESC" to exit. Particle Study 00 The first project borrows from my Perlin Ribbon study from a few months ago, instead using a PNG and some color shifting to represent each point. The Perlin noise affect on the velocity is very aggressive, but somewhat interesting. Download the executable program here . Particle Study 00 Particle Study 01 The second study is actually a return to the original Perlin ribbons. The difference is that I was able to cut out about half of the math I usually use in calculating velocity. I also implemented a form of parallel processing to get a big boost in the speed and quantity of the ribbons. Download the binary here . Particle Study 01 Particle Study 02 This study combines techniques from the previous two. The Perlin noise is toned down dramatically and gravity is introduced. Points in the ribbons are used to control the rotation of the particle (a star graphic here), keeping its orientation relative to the leading edge of the tail. Additive blending and heavy anti-aliasing give it a smooth, glowing appearance. Download here . Particle Study 02 Particle Study 03 This study isn't much to look at, but I felt it was important to include. Sometimes stripping everything away can open doors. Going back to just drawing circles shot out from a linear emitter, I was able to remove some more math and set up a more efficient loop. Download here . Particle Study 03 Particle Study 04 As different as this might look from the previous study, it is very closely related. The application layout I created there allowed for a nice "do-awesome-stuff-here" spot in the code which I could fill in with just about any sort of math to affect each particle's behavior and appearance. Here, I've applied some pseudo-flocking logic to dictate the system's movement, which colors the particles according to their mass, velocity, proximity to others, etc. Download here . Particle Study 04 Particle Study 05 This brush refines a lot of the parameters in the last study to create a system which has a nice spreading tail and emits a lot of particles. Download here . Particle Study 05 Particle Study 06 Happy with the performance and aesthetic of my emitter, I decided to start pushing quantity. I found it tough to control massive numbers using a brush, so I wrote an application which generated the particles first, and then responded to mouse input. To make the system more interesting, I added flocking behavior to the particles, making them look a bit like fireflies. While the other emitters probably didn't break 1,000 particles, this one happily does 4,000. The second video uses 10,000. Download here . Particle Study 06 A - 4,000 particles Particle Study 06 B - 10,000 particles Particle Study 07 At 10,000 quads, the CPU on a fast machine was completely pegged out. It took a lot of optimization to get there. Leveraging some code in this thread from num3ric, I started to work on a GPU-based particle system which draws points instead of textured quads. Paring the code down and applying some parallel processing techniques I'd been using, I managed to go from 10,000 to 100,000 particles straight away. Then 500,000, then 1,000,000, then 2,000,000, then 5,000,000, and up to 6,000,000. I started getting some memory errors and stripped out index and color data... 8,200,000! I turned off Windows 7's aero theme and closed other applications, getting me to 8,479,744 particles at 1920 x 1080 at 40fps! Download a 1,000,000 particle version of the application here . Try using the mouse wheel and dragging the cursor to control the camera. Press "r" to reset the geometry. Particle Study 07 - 8,479,744 particles on the GPU With this research, I've been working hard at adding some interesting interactivity to some nice looking, massive, high performance particle systems. More on that when the time comes.