Particle systems add realism and "eye candy" to a scene, but many implementations are limited by CPU speed.
This is an entirely GPU-based particle system, allowing for many many particles--thousands of times more; here are about 200 thousand. The movement is a little jerky due to the screen-capture, but it runs real-time quite readily. A million particle system has been tested as well, (actually, 1,048,576 particles), still at interactive rates.
This implementation uses a "ping-pong" setup of two framebuffer objects, and 3 render passes (update, draw, and post-process). The first pass uses a 6 multiple render targets to update 3 positions textures, two velocity textures, and a time texture. The second pass uses a vertex shader to transform vertices specified by vertex buffer objects (no transfer time) according to the three positions textures, blending them additively. The third pass uses a fragment shader to apply colors to the monochromatic particles (red additively blended to red does not equal yellow, unless this third pass is done).
The positions textures could probably be consolidated to save 2 texture samples in each of two passes, now that I've added 16 or 32 bit float textures to hold everything.
The fully customizable particle system will be made available in my new OpenGL library, to be released shortly.
I just merged the positions textures, cutting the texture sampling bottleneck 40%. It runs a lot faster now with no noticeable quality loss.
GeometrianGL 2 years ago