Thursday, October 29, 2009

Particle System in The Works!

I've started on my particle system which will come in handy for many effects! I have a really neat fire effect working right now as shown to the left. The image is a screenshot taken on my iPhone, so it appear sideways even though the app is a landscape-based app (I manually do the portrait-to-landscape orientation change via OpenGL ES).

The fire effect you see here is a 256-piece particle system coming from a single emitter. It uses a single 24-bit, 32x32 textures for this effect. It turns out that I do not need an alpha channel to perform additive blending, however, depth testing needs to be disabled in order for this to work!

Performance-wise, I have been able to render 8192 of these particles at once by themselves (nothing else going on) at ~40fps. Keep in mind that not all 8192 vertices are draw onscreen at once. About 35% of the full 8192 particles were at most. I am looking into some performance improvements such as vfp support, and frustum checking which will prevent the particle emitter from processing if outside the camera's field of view.
Functionality-wise, is another story... I do support a lot of neat and interesting controls that allow the user to manipulate the particle emitters, but it does not have enough functionality yet. As soon as I implement and integrate my octree system (that comes with a full-out collision system), I will add collision support to these effects that will allow the particles to collide and bounce off of its surround environment geometry. This should not be really hard since most of the collision detection and response code to do that is already developed. I just need the octree built since the particle emitters will need to use them as references. I plan on adding more functionality to these systems such as adding them into my environment editor we will be using for our latest game, and extending scripting support for it in our scripting engine (also really easy to do).

Here are a couple more screenshots of my work in progress:

No comments:

Post a Comment