Monday, March 15, 2010

I spent about 8 hours today working on the particle system. Here's a short list of the changes I made:

Converted the entire system to use floats instead of doubles, including editing the openGL calls to work with floats instead of doubles. Hopefully not against the rules.

Added methods to Vect4D for things like += and *=.

Attempted to add in Babylonian or quake square roots for normalization, but couldn't get anything working faster. I'll try again tomorrow now that it's all running on floats.

Reordered the variables of Particle, ParticleEmitter, Vect4D and Matrix for caching purposes.

Changed a few functions to pass by reference

Removed some unnecessary temp variables.

Total I sped it up by a factor of two. It's now running at ~11ms update and ~35ms, sitting around ~45-50ms total, after it begin at ~90ms.

Seriously improved the update function, condensing and removing useless crap.

No comments:

Post a Comment