开发者

Single Bone (Matrix Palette) Animation vs. simple rotation/translation of parts

开发者 https://www.devze.com 2023-03-02 13:32 出处:网络
First of all, I\'m using OpenGL ES 1.1 and not 2.0, mostly because I\'ve spent quite a bit of time learning 1.0/1.1 and am pretty comfortable with it.

First of all, I'm using OpenGL ES 1.1 and not 2.0, mostly because I've spent quite a bit of time learning 1.0/1.1 and am pretty comfortable with it.

I took time to learn the use of matrix palettes for animation and after switching gears on a project I've come to a question.

Originally I was using 2 and 3 bone animation because I had the need of weights for certain vertex groups. Now... in the new project I'm working on I will be animating more mechanical things, so the need for more than 1 bone or weighting is unnecessary. I'd like to still use a matrix palette with verts weighted 100% to single开发者_开发知识库 bones... but I wonder if that will cause a performance hit. Instead, I could break a mesh into smaller pieces and do simple translation and rotation between element draw calls. I am concerned, of course, with performance.


TL;DR version: try both ways and see which one performs better.

Really, using palettes for 1-bone animation is something that you can do without too much hassle, and depending on the number of different bones, and the driver overhead on the devices you do it on, might perform better.

It's worth noting that weights can be ignored in a 1-bone model, and the resulting per-vertex code should typically be comparable to a single transform, modulo the indirection to the palette.

That, of course, hinges on the GL implementation to optimize the weighting away. On the other hand, the higher the number of bones, the more draw calls you would have to generate without palettes, and the more you tax the CPU/driver code.

So at a broad level, I'd say that the palette is somewhat more work per-vertex, but significantly less per-bone. Where the tipping point is depends on the platform, as both of those cost can vary significantly.

0

精彩评论

暂无评论...
验证码 换一张
取 消