0
\$\begingroup\$

I am currently attempting to incorporate animated models in my game engine, using Assimp to load the models. I can load and render the static model just fine, but when I try to enable the animation, it basically explodes. I can tell the animation is there and running smoothly, though something isn't working properly.

I have many things to explore in solving the issues at hand, but one in particular is troubling: The code is written to handle 4 bone weights, mostly because it appears to be fairly standard and is easy to pass to the shader. But the model has more than 4 weights per vertex.

So my question is this: What is the best way to handle having more bone weights than the code/shader can handle? Should I run through all the weights and pick the top 4 and adjust them to add up to 1? I could probably code for more weights, but then where does it end?

\$\endgroup\$
2
  • \$\begingroup\$ It sounds like you have a plausible plan in mind. What happens when you put that idea into practice? \$\endgroup\$ Commented Nov 7, 2023 at 2:12
  • \$\begingroup\$ "run through all the weights and pick the top 4 and adjust them to add up to 1" - sounds like a good plan. I have working animations with just 2 weights per vertex - even this performs very good. \$\endgroup\$ Commented Nov 7, 2023 at 6:25

1 Answer 1

0
\$\begingroup\$

So I actually went with an "all of the above" solution to this, and it works perfectly. I went with keeping the top 8 weights and normalize them to 1. This was a good idea anyway, because I found that the weights aren't normalized to 1 in many models.

\$\endgroup\$

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.