Professional Documents
Culture Documents
Gears of War 2
Epic Games
CS-C3100 Fall 2019 – Lehtinen !2
Skinning
• We know how to animate a
bone hierarchy
– Change the joint angles, i.e.,
bone transformations, over
time (keyframing)
• Embed a skeleton into a
Epic Games
detailed character mesh
• Bind skin vertices to bones
– Animate skeleton, skin will
move with it
– But how?
CS-C3100 Fall 2019 – Lehtinen !3
Skinning
• Need to infer how skin deforms
from bone transformations.
• Most popular technique:
Skeletal Subspace Deformation
(SSD), or simply skinning
– Other aliases
• vertex blending
• matrix palette skinning
• linear blend skinning
Colored
triangles are
attached to 1
bone
Black
triangles are
attached to
more than 1
Note how
they are near
joints
James & Twigg 2005 CS-C3100 Fall 2019 – Lehtinen !9
Examples
Colored
triangles are
attached to 1
bone
Black
triangles are
attached to
more than 1
Note how
they are near
joints
James & Twigg 2005 CS-C3100 Fall 2019 – Lehtinen !10
Vertex Weights
• We’ll assign a weight wij
for each vertex pi for each bone Bj.
– “How much vertex i should move with bone j”
Epic Games
CS-C3100 Fall 2019 – Lehtinen !20
Linear Blend Skinning: Basic Idea
• Step 1: Transform each vertex pi with each bone
as if it was tied to it rigidly.
“ ”
transformed using
pij = T j pi bone j.
Tj is the current
transformation of
pi = wij pij bone j.
j p’i is the new
skinned position of
vertex i.
CS-C3100 Fall 2019 – Lehtinen !23
Computing Vertex Positions
• Vertex p0 has
Rest (“bind”) pose
weights
w01=0.5,
Bone 1: T1 Bone 2: T2
w02=0.5
p0
“Skin”
p’01 p’02
CS-C3100 Fall 2019 – Lehtinen !25
Computing Vertex Positions
• Vertex p0 has
Rest (“bind”) pose
weights
w01=0.5,
Bone 1: T1 Bone 2: T2
w02=0.5
p0 • Transform by
After rotations “Skin”
T’1 and T’2
Bo yields p’01, p’02
ne T’2
:
1:
T’ n e 2 • the new position
1 Bo is p’0=
0.5*p’1 +
p’01 p’0 p’02 0.5*p’2
CS-C3100 Fall 2019 – Lehtinen !26
Computing Vertex Positions
• Vertex p0 has
Rest (“bind”) pose
weights
w01=0.5,
Bone 1: T1 Bone 2: T2
w02=0.5
p0 • Transform by
After rotations “Skin”
T’1 and T’2
Bo yields p’01, p’02
ne : T 2
1: e 2 • the new position
T’
Bon
1
is p’0=
“Skin” 0.5*p’1 +
p’01 p’0 p’02 0.5*p’2
CS-C3100 Fall 2019 – Lehtinen !27
SSD is Not Perfect
q0
p0
After rotations
okino.com
CS-C3100 Fall 2019 – Lehtinen !30
Bind Pose
• We are given a skeleton and a
skin mesh in a default pose
– Called “bind pose”
– Undeformed vertices pi are given
in the object space of the skin
• Previously we conveniently
forgot that in order for
p’ij = Tj pi to make sense,
coordinate systems must
match up.
okino.com
CS-C3100 Fall 2019 – Lehtinen !31
Bind Pose cont’d
• In the rigging phase, we
Bn
line the skeleton up with the
undeformed skin.
– This gives some “rest pose”
....
bone transformations Bj
B2
B1
okino.com
CS-C3100 Fall 2019 – Lehtinen !32
Bind Pose cont’d
• In the rigging phase, we
Bn
line the skeleton up with the
undeformed skin.
– This gives some “rest pose”
....
bone transformations Bj
• We then figure out the vertex
B2
weights wij.
– How? Usually paint by hand!
– Pinocchio was the algorithm
B1
that does this automatically
okino.com
CS-C3100 Fall 2019 – Lehtinen !33
Bind Pose cont’d
• When we animate the model,
the bone transformations
Tj change.
okino.com
CS-C3100 Fall 2019 – Lehtinen !34
Bind Pose cont’d
• When we animate the model,
the bone transformations
Tj change.
– What is Tj? It maps from the
local coordinate system of
bone j to object space.
• Remember hierarchical modeling!
okino.com
CS-C3100 Fall 2019 – Lehtinen !35
Bind Pose cont’d
• When we animate the model,
the bone transformations
Tj change.
– What is Tj? It maps from the
local coordinate system of
bone j to object space.
• To be able to deform pi according
to Tj, we must first express pi in the local
coordinate system of bone j.
– This is where the bind pose
bone transformations Bj come in.
okino.com
CS-C3100 Fall 2019 – Lehtinen !36
Bind Pose cont’d
• To be able to deform pi
according to Tj, we must
first express pi in the
local coordinate system of bone j.
– This is where the bind pose
bone transformations Bj come in.
⇥
pij = T j B j pi 1
⇥
pij = T j B j pi 1
j
• Inverse transpose for normals!
⇤ ⇥ T
⇥
ni = wij T j (t)B j 1
ni
j
CS-C3100 Fall 2019 – Lehtinen !44
Skinning Pseudocode
• Do the usual forward kinematics
– maybe quaternion interpolation for rotations
– get a matrix Tj(t) per bone
• For each skin vertex pi
⇥
pi = wij T j (t)B j pi 1
j
• Note that the weights are constant over time
– Only a small number of matrices change
– This enables implementation on GPU “vertex shaders”
(little information to update for each frame)
CS-C3100 Fall 2019 – Lehtinen !45
Questions?
• But wait... ⇥
⇧
pi =
⇥ ⇤ wij T j (t)B j 1⌅
pi
j
• But wait... ⇥
⇧
pi =
⇥ ⇤ wij T j (t)B j 1⌅
pi
j
✘
✔ CS-C3100 Fall 2019 – Lehtinen !51
Usual Solution
• Have the artists deal with it O:-)