Author Topic: How to improve the performance of animation?  (Read 1723 times)

Offline kiffa

  • long
  • ***
  • Posts: 199
    • View Profile
How to improve the performance of animation?
« on: July 29, 2012, 02:13:47 pm »
My dog has 10364 triangles.

On my phone, the static-dog-fps is about 60, that's not bad, but when played the skin-animation, the fps dropped to only 6 fps, it seemed to be rather slow.

I have refered to jpct-ae-wiki-"Performance tips for Android", but seemed to be little help with my situation.

So, are there any advices to improve the performance of animation without reducing the faces of dog-model?

I am a beginner of 3D-graphics, so i want to know why an animating-object is much slower than the static one? What's the hotspot? And how to resolve it? I have tried to do the profiling with android-ADT,  and seemed like that the applySkeletonPose() cost the most cpu-time. I don't know if the bones-animation used the gpu(or other graphic-hardware) power, and how to profile this.  And how the hardware of a phone affect the performance, which is the most important factor: cpu、ram、gpu or others?


And my code is rather simple:
    Load an .bones animated-object, set AmbientLight, then play skin-animation.

There is almost little difference of the performance  between opengles-1.X and opengles-2.0 with my simple project.

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1991
    • View Profile
Re: How to improve the performance of animation?
« Reply #1 on: July 29, 2012, 06:16:04 pm »
well the short answer is lower your polygon count. there is no other way, sorry :( 10.000+ polygons is still quite a lot for such devices.

skeletal animation does quite a lot of heavy matrix operations, that's the reason. thanks to EgonOlsen, he did some low level optimizations to applySkeletonPose() method and we got a 5-10% improvement, that's all we got, better than nothing of course ;)

another bottleneck is, the vertices should be uploaded from CPU to GPU every frame. we tried native libraries but didnt actually helped.

GPU is not involved in these calculations. It's possible indeed, called GPU skinning, means doing that calculations in GPU, but I have no intention to implement that, at least for now

lower your polygon count..