Thursday, January 1, 2009

Another OpenGL Particle System Teaser




This is just one possible configuration - one of the simpler ones, actually, as it is only using point rendering and simple gravity - no textures, no wind, no transparency, etc. I call this configuration "fountain", and it's can be created in one line of code:
ParticleEmitter3D *fountain = [ParticleEmitter3D fountain];
then, you just need to tell the fountain to draw itself each time through your draw loop or callback...
[fountain drawSelf];
It's probably going to be a few days before I get the first version of the code posted - it's got some rough edges still, plus a few more bits of functionality I feel are needed before it can survive public scrutiny.

The above movie was taken on the simulator. The code does work on my first generation iPhone but I have to reduce the number of points emitted per second to get it to look good with no hiccups. I haven't yet tested it on my second generation iPod Touch to see how much of a difference the new processor and FPU make. I'm also hoping that pooling and reusing the particles, rather than constantly allocating and freeing them will help a fair amount.

No comments:

Post a Comment