ammychoice

Hello!
I want a few answers on some questions).

Does keyframe count matter for game performance on pixijs?

For example, i have animation, 1 timeline with 1000 frames, and key in every frame, its 1000 keyframes
And in another example i have 1 timeline with 1000 frames but i have only 2 keys, in 1 and 1000 frame. What it cost for performance optimisation. Does less keys is better for games? Or it is the same. And i dont need answer like, 2 keys best because you can handle your animation better and so on. i ask about performance.

What it cost?

In spine documentation metrics you write that: "Even a timeline that has only 1 key at frame 0 is still applied every time the animation is applied to the skeleton.". Is this mean that it will be no matter with 1000 keys and 2 keys? or less keys much better for performance. :scared:
ammychoice
  • Bài viết: 2

Nate

Fewer keys is less data which means slightly shorter load times and slightly less work at runtime. Each timeline needs to find the key before and the key after the current animation time. The code for that is a binary search in < v4 but we've profiled it and changed to a linear search in v4. The code is:
spine-runtimes/Animation.java at 3.8

While fewer keys (and fewer timelines) is generally better, the number of keys is usually not the most important aspect to worry about. Both loading and finding the keys is fast, so making it slightly faster likely has little impact. However, deform keys can be very large and should either be avoided (use a mesh weighted to bones instead) or used very sparingly. It is likely more important to keep an eye on the number of vertex transforms.
Hình đại diện của thành viên
Nate

Nate
  • Bài viết: 9834

ammychoice

thanks a lot 8)
ammychoice
  • Bài viết: 2


Quay về Editor