I recently started to optimise my Engine. Using VS2012 Performance analysing tool, I quickly found the biggest bottlenecks.
By far the biggest one are my animations. I already managed to go up from 100Fps with 1 simple animated model to 150Fps with 50. While that is not bad, I still need it to get better.
I fixed everything I could, but I don't know how to continue. The major performance-eaters are
which are an essential part of the computation that bone-based animations need, right?
Is there a way to work around those or are there cheaper ways to compute bb animations?
Those two take around 50%, the other 50% are beeing lost to stuff like
tempVert->pos.x += ( tempJoint->pos.x + rotatedPoint.x ) * tempWeight->bias; // or tempVert->normal.x -= rotatedPoint2.x * tempWeight->bias; // or currentSubset->vertices[i]->normal = -tempVert->normal;
( All CPU % in %-of-the-full-time in an uncapped application )
With 5% of the complete CPU time each. I don't understand why those are so very expensive.
Stuff like sqrt, sin and maybe even / are concidered expensive, but why are the basic math operations also a problem?
I am adding the full code of the function in question below, adding the % of CPU to the end of each line which is over 0.1%.
I tried to make it as readable as possible, but the Copy-paste into this forum still screws it up, I'm sorry.
I am new to profiling and optimising, so any tips are welcome!
Thanks for your time!