Dogfight is coming along pretty well, I’ve started writing a particle engine, which is tricky as it was one of my main responsibilities at Sony and I had a pretty complex and full featured system. The tricky part is stopping myself from over engineering it and instead write the most bare bones system possible. I always doubted whether the artists needed / used all the features I added anyway.
In general with particle systems there are two types, the uber-emitter which is one monolithic class with a thousand options, tick boxes and modes, this type is easy to start with but then quickly becomes rather messy as you add options.
The second type is module based where you essentially hook modules together in an “update chain”, this is what I had at Sony running on the SPUs, it’s nice but has runtime overhead in that you usually will need to do multiple passes over the data allowing each module to modify the particle data at spawn and update time. An optimization of this type of system is to link the modules together at compile time so that you literally compile an update loop specific to a set of modules and options. This is pretty much the best of both worlds except that your iteration time now includes a C++ compilation step which isn’t great for artists.
In Dogfight I’m going the uber-emitter approach, I don’t think you can get away with multiple passes over the data on something like the iPhone, although I might add update modules for things like vortex fields and more expensive updates.
This also leads me to a rant on point sprites, basically point sprites are a complete pile of shit. They can’t do anything interesting, you can’t rotate them, you can’t animate the uvs, you can’t billboard along a vector for trail like effects. Also the GL_OES_point_sprite extension culls the sprite based on the point position so as it goes off screen the entire sprite will disappear even though half of it is still on screen!
If you have vertex shaders this is all a non issue, using two vertex streams, one for your particle data and one for your uv data you set the divisor on the particle stream to 4 and the modulo on the uv data to 4 and you’ve quartered the amount of data you need to send to card.
Inside the vertex shader you can then do rotation or interesting billboarding. Nice and fast, minimal API calls. If only embedded devices had them.