Graphics Reference
In-Depth Information
A bone's affine transformation matrix is able to influence a vertex's
translation, rotation, and scale.
The transformation to bone space involves calculating the current translation and rotation for
each bone, as well as its scale against its parent bone. This initial transform is now in the bind
pose or rest pose space. To bring the transform into bone space, we apply the inverse bind
pose matrix of the bone. The following figure shows the bones at rest (in the top-left), and in
various poses for the remaining layouts.
Rest or bind pose
Bone B rotated -90 degrees
position in
bone A space
vertex with weights:
Bone A: 0.5
Bone B: 0.5
vertex with weights:
Bone A: 0.0
Bone B: 1.0
surface / skin
weighted /
interpolated position
position in
bone B space
Parent Bone A
Parent Bone A
Child Bone B
Bone A and B rotated
-90 degrees
Bone A rotate -90 degrees
Bone B rotate +90 degrees
Child Bone B
Blending of bone influences upon a vertex, and relationship between parent/child bones
This resulting skin matrix for each bone is what we are storing in the PerArmature constant
buffer, and it is the matrix that we refer to within the vertex shader.
Within the vertex shader, we blend the bone influences together based upon their weight.
The previous figure shows how the central vertex is influenced equally by the two bones,
by using a weighting of 0.5 for each bone. The following pseudocode shows how the final
transform matrix for this vertex would be calculated from the skin matrices of bone A and B .
float4x4 transform = Bones[A] * 0.5 +
Bones[B] * 0.5;
 
Search WWH ::




Custom Search