Sign in to follow this  
  • entries
    162
  • comments
    262
  • views
    166906

Water Ripples

Sign in to follow this  
OrangyTang

81 views

I was wrong, there was quite a bit left to optimised in the ring geometry generation code. I managed to move the angle and texture coord calculations mostly out of the loop so that they just end up being a single add and assignment instead of multiple adds, multiplies and divides. Another big gain was replacing the sin and cos methods with a lookup table, done with yakly angles to further minimise arithmatic operations.

The actual loop is now just a handful of multiplies and adds, and two array lookups. For 500 rings, this means that I've gone from 6fps (the original, unoptimised version) to 32fps and these final optimisations take it to 48fps. Thats about eight and a half times faster. [grin]

With this new-found speed Rescue Squad now runs at 60fps with the water ripples turned on, which is nice.



They need some more tweeking on the animation side of things, but already they add a certain degree of solidity to the water plane that wasn't really there before.
Sign in to follow this  


1 Comment


Recommended Comments

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now