Docsity

Smooth Skin Algorithm: Weighted Blending and Averaging for 3D Animation, Slides of Computer Graphics and Animation

Partial preview of the text

Download Smooth Skin Algorithm: Weighted Blending and Averaging for 3D Animation and more Slides Computer Graphics and Animation in PDF only on Docsity!

Smooth Skin Algorithm

Weighted Blending & Averaging

 Weighted sum:

 Weighted average:

 Convex average: 0 1 1 0 0 ≤ ≤ = ′ = ∑ ∑ = = i i i i i i w w x w x

Simple Skin

 A simple improvement for low-medium quality

characters is to rigidly bind a skin to the skeleton.

This means that every vertex of the continuous

skin mesh is attached to a joint.

 In this method, as with rigid parts, every vertex

is transformed exactly once and should

therefore have similar performance to rendering

with rigid parts.

v ′ = W ⋅ v

Smooth Skin

 With the smooth skin algorithm, a vertex can be

attached to more than one joint with adjustable

weights that control how much each joint affects

it

 Verts rarely need to be attached to more than

three joints

 Each vertex is transformed a few times and the

results are blended

 The smooth skin algorithm has many other

names: blended skin, skeletal subspace

deformation (SSD), multi-matrix skin, matrix

palette skinning…

Binding Matrices

 With rigid parts or simple skin, v can be defined local to

the joint that transforms it

 With smooth skin, several joints transform a vertex, but it

can’t be defined local to all of them

 Instead, we must first transform it to be local to the joint

that will then transform it to the world

 To do this, we use a binding matrix B for each joint that

defines where the joint was when the skin was attached

and premultiply its inverse with the world matrix:

− 1 = ⋅ i i i M W B

Normals

 To compute shading, we need to transform the normals to world space also  Because the normal is a direction vector, we don’t want it to get the translation from the matrix, so we only need to multiply the normal by the upper 3x3 portion of the matrix  For a normal bound to only one joint: n ′ = W ⋅ n

Algorithm Overview

Skin::Update() (view independent processing)  Compute skinning matrix for each joint: M=W · B

- (you can precompute and store B

instead of B )  Loop through vertices and compute blended position & normal Skin::Draw() (view dependent processing)  Set matrix state to Identity (world)  Loop through triangles and draw using world space positions & normals Questions:

  • Why not deal with B in Skeleton::Update()?
  • Why not just transform vertices within Skin::Draw()?

Rig Data Flow

 Input DOFs

 Rigging system

(skeleton, skin…)

 Output renderable mesh

(vertices, normals…)

[ ] N φ φ ... φ 1 2 Ö = v ′, n ′ Rig

Smooth Skin Algorithm

 The deformed vertex position is a weighted average over all of the joints that the vertex is attached to:  W is a joint’s world matrix and B is a joint’s binding matrix that describes where it’s world matrix was when it was attached to the skin model (at skin creation time)  Each joint transforms the vertex as if it were rigidly attached, and then those results are blended based on user specified weights  All of the weights must add up to 1:  Blending normals is essentially the same, except we transform them as direction vectors (x,y,z,0) and then renormalize the results ∑ ′ (^) = ⋅ ⋅ − v W B v 1 i i i w ∑ wi =^1

  • 1 , n n n = W ⋅ B ⋅ n n ′ = ∑ − i i i w

Skinning Equations

( )

  • 1 1 1 2 , ,..., n n n n W B n v W B v W W L L L ′ = = ⋅ ⋅ ′ = ⋅ ⋅ = ⋅ = ∑ ∑ − − i i i i i i parent jnt N w w  Skeleton φ φ φ  Skinning

Limitations of Smooth Skin

 Smooth skin is very simple and quite fast, but its

quality is limited

 The main problems are:

 Joints tend to collapse as they bend more

 Very difficult to get specific control

 Unintuitive and difficult to edit

 Still, it is built in to most 3D animation packages

and has support in both OpenGL and Direct3D

 If nothing else, it is a good baseline upon which

more complex schemes can be built

Limitations of Smooth Skin

Shape Interpolation

 Another extension to the smooth skinning

algorithm is to allow the verts to be modeled at

key values along the joints motion

 For an elbow, for example, one could model it

straight, then model it fully bent

 These shapes are interpolated local to the

bones before the skinning is applied

 We will talk more about this technique in the

next lecture

Muscles & Other Effects

 One can add custom effects such as muscle

bulges as additional joints

 For example, the bicep could be a translational

or scaling joint that smoothly controls some of

the verts in the upper arm. Its motion could be

linked to the motion of the elbow rotation.

 With this approach, one can also use skin for

muscles, fat bulges, facial expressions, and

even simple clothing

 We will learn more about advanced skinning

techniques in a later lecture