Original Post
I have been working on getting animation going and I'm at the tail end of it. The problem I'm running into is how to allow a shader to animate multiple objects. It seems like unless the animated objects are very similar (i.e. number of bones/joints, number of bones/jones that effect a single vertex) one would need a different shader for each object.
For example:
attribute vec2 Index;
attribute vec2 Weight;
uniform mat4 Bone[10];
works for an animation with 10 bones and only have 2 bones effect a vertex. But if one wanted an animation with 15 bones and 3 bones effecting a vertex its a problem. Is it the norm to have a different shader for each animated object?
Also, if we have a maximum of 2 bones effecting a vertex, is it necessary to pad for all vertices that only have 1 bone effecting them?
Thanks!
For example:
attribute vec2 Index;
attribute vec2 Weight;
uniform mat4 Bone[10];
works for an animation with 10 bones and only have 2 bones effect a vertex. But if one wanted an animation with 15 bones and 3 bones effecting a vertex its a problem. Is it the norm to have a different shader for each animated object?
Also, if we have a maximum of 2 bones effecting a vertex, is it necessary to pad for all vertices that only have 1 bone effecting them?
Thanks!