Skeletal Animation Issues
Ok I looked at the msdn documents and saw some flags to fix and stuff. It did up my frame rate but only too 70 with just the skeleton. I did just realize I don't think its the copy, when I comment out the once per frame copy, it only bumps up the frame rate to about 95. On the other hand when I comment out the "EvaluateJoints" and the "TransformVertices" functions the frame rate is like 2000+ ( that sounds high, but the total triangles rendered is only 700 so I believe it). That leads me to believe my functions are sucking!
Thanks again
Thanks again
When you profile, don't look at FPS, look at how long each frame took (in milliseconds most commonly)
Check this out...
let's say one frame took 5 milliseconds to calculate/render. That would be 200 frames per second.
If that frame took 10 milliseconds, it would be 100 frames per second.
If it took 15 milliseconds, that is about 66FPS.
To see it more plainly look at this:
5ms = 200fps
10ms = 100fps
15ms = 66fps
20ms = 50fps
25ms = 40fps
30ms = 33fps
35ms = 28fps
40ms = 25fps
as you can see, the difference between 25fps and 28fps is the same as the difference between 100fps and 200fps!
So basically, looking at fps can be really misleading. Instead look at how many milliseconds each frame took when profiling to get a real sense of performance changes (:
Check this out...
let's say one frame took 5 milliseconds to calculate/render. That would be 200 frames per second.
If that frame took 10 milliseconds, it would be 100 frames per second.
If it took 15 milliseconds, that is about 66FPS.
To see it more plainly look at this:
5ms = 200fps
10ms = 100fps
15ms = 66fps
20ms = 50fps
25ms = 40fps
30ms = 33fps
35ms = 28fps
40ms = 25fps
as you can see, the difference between 25fps and 28fps is the same as the difference between 100fps and 200fps!
So basically, looking at fps can be really misleading. Instead look at how many milliseconds each frame took when profiling to get a real sense of performance changes (:
Fair enough,
I tried it your way and:
With evaluate and transforming and copy verts = 8.814 ms = 113 fps
without copy = 8.8 = 113 fps
no transform = 2.0 = 500 fps
no evaluate = 8.8 = 113fps
no transform and no evaluate with copy alone = 1.31
so they are all at least 100 fps.... I check multple times. Why would the fps counter make a different result. I just count each frame and when i hit one second checked the value.
So I probably need to optimize my tranform code thanks!
I tried it your way and:
With evaluate and transforming and copy verts = 8.814 ms = 113 fps
without copy = 8.8 = 113 fps
no transform = 2.0 = 500 fps
no evaluate = 8.8 = 113fps
no transform and no evaluate with copy alone = 1.31
so they are all at least 100 fps.... I check multple times. Why would the fps counter make a different result. I just count each frame and when i hit one second checked the value.
So I probably need to optimize my tranform code thanks!
Quote:Why would the fps counter make a different result. I just count each frame and when i hit one second checked the value
Because as Atrix showed the distribution of the framerate is different and less useful than the distribution of elapsed time. The elapsed time is a linear function x, while the framerate is a hyperbola following 1/x where x is the elapsed time. The framerate may be more intuitive and work reasonable around a target framerate of 60, but because of the shape of the hyperbola the FPS figure becomes less meaningful as the elapsed time gets smaller (or larger, to a lesser extent).
Quote:So I probably need to optimize my tranform code thanks!
Bear in mind that straightforward optimization of your own code may not cut it. Transforming vertices already is a quite intense floating point operation and with skinning and multiple bone weights, you'll probably be doing up to 4 times as many transforms as with normal matrix transforms. These floating point operations can be rather hard on your processor, so it might be a good idea to look for a specialized vector/matrix math library that makes use of the floating point and SIMD capabilities of your processor. I'm not sure, but I seem to recall that the XNAMath library from MS (despite its name it's meant for C++ / DirectX) uses these processor features.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement