3
votes

Writing hardware skinning for my game and need to animate normals too. From this article I learned that usually to transform normals you need something like this:

transformed_normal = transpose(inverse(bone[i])) * normal;

I can't pass second set of precalculated transpose(inverse(bones)) to shader via uniforms because I don't have enough uniforms for that. So I have to calculate this transpose(inverse(bone[i])) in vertex shader (again and again for every one of thousands vertices), isn't it? Is there some faster way to do this? Some cheap and dirty approximation of this operation?

Edit: Found this cool solution https://stackoverflow.com/a/46518010/9173149

1

1 Answers

6
votes

The typical way to handle this is to not put scaling in your bone matrices. If the bone transformations only have rotation and translation, doing the inverse/transpose is unnecessary.