Algorithm Search⌘K

Problemintro

Character skinning

Also called mesh skinning.

Deform the surface mesh of a character from the transforms of its skeleton joints, smoothly and without artifacts at the joints.

Character skinning is the problem of moving the skin mesh of a character with its skeleton. The skeleton gives a rigid transform per joint in each frame, and the skin must follow it: rigid where a part of the body is rigid, smooth across the joints, with no loss of volume and no folds where none belong. There is no single correct answer, because a real limb is not a function of its joints alone; methods are judged by the properties they prove, by their artifacts and by their cost per frame. It is a special case of shape deformation, where the handles are the joints of a skeleton; the methods for it are on the algorithm pages listed below.

In plain words

A character has a skin made of many small triangles and an inner skeleton made of a few joints. When the joints move, every point of the skin must move too, in a way that looks right. Points in the middle of the upper arm should move with the upper arm. Points near the elbow should move partly with the upper arm and partly with the forearm, so that the skin bends smoothly. The hard part is to bend and twist the skin without making it thin, flat or crumpled at the joints, and to do it many times per second for many characters.

Definition

Input.

  • The rest mesh: nn vertices v1,…,vnv_1, \ldots, v_n with their normals and ff triangles, in the bind pose.
  • The skeleton with jj joints, the world transforms B0,…,Bj−1B_0, \ldots, B_{j-1} of the bind pose and, in each frame, the world transforms M0,…,Mj−1M_0, \ldots, M_{j-1} of the pose; together they give the skinning matrices Ca=MaBa−1C_a = M_a B_a^{-1}.
  • The weights: for each vertex ii at most kk pairs (a,wia)(a, w_{ia}) with wia≥0w_{ia} \ge 0 and ∑awia=1\sum_a w_{ia} = 1.

Output. The deformed positions v1′,…,vn′v'_1, \ldots, v'_n and normals of the frame.

Requirements. A method should meet these; the first three are exact properties that a page can prove.

  1. In the bind pose, where every Ca=IC_a = I, the output is the rest mesh.
  2. A vertex with one joint of weight 1 moves rigidly with that joint: v′=Cavv' = C_a v.
  3. If every joint moves by the same rigid motion GG, the mesh moves by GG.
  4. The output depends smoothly on the pose and on the weights.
  5. The volume near a joint is kept in a bend and a twist (no candy wrapper artifact, no collapsing elbow), and there is no bulge where none belongs.
  6. Optionally: the skin does not pass through itself, and it bulges where parts press together.

Cost model. The real-RAM model; the cost per frame is given in nn, jj and kk, apart from a precomputation that runs once for the rest mesh. The weights are given here; finding them is a separate problem (see Variants).

Variants

  • Rigging. Find the skeleton and the weights for a rest mesh; see automatic rigging and bounded biharmonic weights.
  • Skinning decomposition. The inverse problem: given example meshes, find the weights and the joint transforms that best reproduce them (see skinning decomposition).
  • Example-based skinning. Given sculpted meshes at some poses, interpolate corrections over the pose space (see pose-space deformation).
  • Skinning with contact. Add requirement 6, as implicit skinning does.
  • Skinning with scale. Allow scale in the joint transforms, as for stretchy cartoon limbs; this rules out methods that blend only rigid transforms.

Examples

The twist. Take two joints with the weights 0.50.5 and 0.50.5, where joint 0 stays at the identity and joint 1 turns by π\pi about the xx axis. The vertex (0,1,0)(0, 1, 0) should turn by π/2\pi/2, to (0,0,1)(0, 0, 1), since it lies halfway in weight. Linear blend skinning gives 0.5(0,1,0)+0.5(0,−1,0)=(0,0,0)0.5 (0, 1, 0) + 0.5 (0, -1, 0) = (0, 0, 0): the vertex falls onto the axis. Dual quaternion skinning gives (0,0,1)(0, 0, 1) and keeps the radius 1.

The bend. Take the elbow at (1,0,0)(1, 0, 0), joint 0 at the identity and joint 1 bent by π/2\pi/2 about the zz axis through the elbow, and the vertex (1.5,0.2,0)(1.5, 0.2, 0) with the weights 0.50.5 and 0.50.5; it is at the distance 0.538520.53852 from the elbow. LBS gives (1.15,0.35,0)(1.15, 0.35, 0), at the distance 0.380790.38079 from the elbow. DQS gives (1.21213,0.49497,0)(1.21213, 0.49497, 0), a turn by π/4\pi/4 about the elbow, at the distance 0.538520.53852.

Known algorithms

method per frame precomputation main property and limit
linear blend skinning O(j+nk)O(j + n k) none requirements 1 to 4; loses volume in twists and bends
dual quaternion skinning O(j+nk)O(j + n k) none each vertex moves rigidly when the blended real part is not zero; bulges in bends, does not blend scale
spherical blend skinning O(j+nk)O(j + n k) plus one center per set of joints none rigid per vertex, about a least squares center of rotation
optimized centers of rotation O(j+nk)O(j + n k) a center per vertex from the similarity of the weights rigid rotation about the center; the paper reports less bulge than DQS
implicit skinning O(j+n(k+ij))O(j + n (k + i j)) for ii projection steps a field per bone a correction with contact and bulges; iterative
delta mush O(j+nk+K(n+f))O(j + n k + K (n + f)) for KK smoothing steps the deltas of the rest mesh a correction that hides rough weights; does not keep the radius in a twist
pose-space deformation the correction of the examples near the pose sculpted examples adds artist-made shapes on top of a skinning

The first four are direct methods: each vertex is a function of its own weights, its rest position and the palette. The last three use the mesh or extra data.

AlgorithmTimeSpacePropertiesCode
Automatic rigging by heat diffusionO(B C^2 n + J C^J log C) embeddingO(B C^2 + J C^J + n^2) extradeterministicnot exactofflineiterative1 language
Bounded biharmonic weightsO(n^3 + m I n^3) totalO(n^2 + m n) extradeterministicexactofflineiterative1 language
Delta mushO(j + n k + K (n + f)) frameO(n + f) extradeterministicexactofflineiterative1 language
Dual quaternion skinningO(j + n k) frameO(j) extradeterministicexactofflineiterative1 language
Implicit skinningO(j + n (k + i j)) frameO(n + j) extradeterministicnot exactofflineiterative1 language
Linear blend skinningO(j + n k) frameO(j) extradeterministicexactofflineiterative1 language
Optimized centers of rotation skinningO(j + n k) frameO(n + m) extradeterministicexactofflineiterative1 language
Pose space deformationO(m j + j + n (m + k)) frameO(m n + m^2) extradeterministicexactofflineiterative1 language
Smooth skinning decomposition with rigid bonesO(n 2^B (B^3 + B^2 F) + B F n K) iterationO(n B + B F) extradeterministicnot exactofflineiterative1 language
Spherical blend skinningO(j + n k^2) frameO(j + n) extradeterministicexactofflineiterative1 language

Bounds

  • Lower bound. Every output vertex depends on its weights, so a method that reads them needs Ω(nk)\Omega(n k) time per frame in the worst case, and the palette needs Ω(j)\Omega(j). LBS and DQS meet this bound.
  • No linear blend is rigid. A weighted average of rotation matrices is not a rotation in general, so no method that blends the matrices CaC_a linearly meets requirement 5 for every pose; see candy wrapper artifact for the proof.
  • Direct methods cannot model contact. In a direct method, two vertices with the same rest position and the same weights move together in every pose, whatever the rest of the mesh does; so the inner side of a bend cannot stop at the other side, and requirement 6 needs a method that looks at the mesh.

Reductions

  • LBS is a matrix product. Stack the top three rows of the matrices CaC_a side by side into a 3×4j3 \times 4j matrix CC, and let AA be the 4j×n4j \times n matrix whose column ii has the block wia(vi,1)w_{ia} (v_i, 1) at the rows of joint aa. Then the deformed vertices are the columns of CAC A. This is the form that skinning decomposition fits.
  • Skinning as shape deformation. A skinning method is a deformation with jj rigid handles and fixed weights per vertex, so the methods of shape deformation with handles apply, at a higher cost.
  • Skinning of one limb from two joints. The two-joint twist and bend above are the test cases of every method; a method that fails them fails on characters.

Applications

  • Real-time characters in games and VR, skinned on the GPU from a palette of joint matrices; glTF stores up to four joints and weights per vertex in each set of attributes.
  • Film characters, where a fast skinning gives the base and corrections, simulation and sculpted shapes go on top.
  • Bodies for cloth and hair simulation, which need the skinned mesh as a collision surface.
  • Skeletal animation in general: retargeted motion capture and crowds reuse one skinned mesh for many motions.

References

  1. Ladislav Kavan, Part I, Direct skinning methods and deformation primitives, in Alec Jacobson, Zhigang Deng, Ladislav Kavan and J. P. Lewis, Skinning, Real-time Shape Deformation, SIGGRAPH 2014 course, Section 2 (linear blend skinning and the candy wrapper artifact) and Section 4 (dual quaternion blending and the bulging artifact)
  2. Ladislav Kavan, Steven Collins, Jiří Žára and Carol O'Sullivan, Geometric skinning with approximate dual quaternion blending, ACM Transactions on Graphics 27(4), article 105, 2008, Section 2 (previous skinning methods) and Section 2.2 (linear blend skinning)
  3. The Khronos Group, glTF 2.0 Specification, Section 3.7.3 (skins, inverse bind matrices, and sets of four joints and weights per vertex)

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW2 basic
  • a contract.yaml