Graphics Reference
In-Depth Information
Figure 1.7.
Matrix palette skinning (left) and direct quaternion blending (right). [Image
courtesy of Mail.Ru Group.]
pack all bones of all characters in a single 2D texture, the format of which is
discussed below. In fact, we use this texture as a “large constant buffer” which
we dynamically address using an instance ID, in order to make skinning work for
many characters on DirectX 9 compatible hardware.
A straightforward solution for using quaternions in skinning would be to in-
terpolate quaternions, corresponding to different bones,
before
applying rotation;
in the same way as matrices are interpolated in the
matrix palette skinning
ap-
proach, as proposed in [Hejl 04]. However, our experience shows that this method
produces incorrect results when a vertex is skinned to several bones, which have
significant rotation from a bind pose, as shown in Figure 1.7.
The mathematical reason for this lies in the fact that quaternions
cannot be
correctly blended
. Provided quaternions can be very effectively
interpolated
,this
sounds a bit controversial; therefore we provide a proof below.
Let us consider Figure 1.8. A quaternion
q
2
defines a 180
◦
rotation in an
xy-plane and
q
3
corresponds to a 180 +
◦
rotation. If we blend quaternions
q
1
,
q
2
and
q
1
,
q
3
with weights
λ
1
=
λ
2
=
λ
3
=0
.
5, resulting quaternions
q
4
and
q
5
will point in significantly different directions if we use shortest-arc interpolation
for blending. Taking
infinitely small proves that the blending result of
q
1
and
q
2
(
q
3
)isnot
continuous
.
−