Fast and Efficient Skinning of Animated Meshes
Total Page:16
File Type:pdf, Size:1020Kb
EUROGRAPHICS 2010 / T. Akenine-Möller and M. Zwicker Volume 29 (2010), Number 2 (Guest Editors) Fast and Efficient Skinning of Animated Meshes , L. Kavan1 2,P.-P.Sloan1 and C. O’Sullivan2 1Disney Interactive Studios, USA 2Trinity College Dublin, Ireland Abstract Skinning is a simple yet popular deformation technique combining compact storage with efficient hardware accel- erated rendering. While skinned meshes (such as virtual characters) are traditionally created by artists, previous work proposes algorithms to construct skinning automatically from a given vertex animation. However, these meth- ods typically perform well only for a certain class of input sequences and often require long pre-processing times. We present an algorithm based on iterative coordinate descent optimization which handles arbitrary animations and produces more accurate approximations than previous techniques, while using only standard linear skinning without any modifications or extensions. To overcome the computational complexity associated with the iterative optimization, we work in a suitable linear subspace (obtained by quick approximate dimensionality reduction) and take advantage of the typically very sparse vertex weights. As a result, our method requires about one or two orders of magnitude less pre-processing time than previous methods. Categories and Subject Descriptors (according to ACM CCS): Computer Graphics [I.3.7]: Three-Dimensional Graphics and Realism—Animation 1. Introduction standard in most interactive applications. The sparsity con- straint is crucial for efficient evaluation of Formula (1), es- Linear blend skinning (also known as matrix palette skin- pecially when implemented on graphics hardware. ning) is a mesh deformation technique implemented in al- most all modern 3D engines, most frequently used for vir- An animated mesh with fixed connectivitycan be repre- tual characters driven by skeletal animation. However, re- sented by a 3F × N matrix A,whereF is the number of cent research suggests new possible applications, including frames and N the number of vertices: animation of highly deformable objects, such as cloth. ⎛ ⎞ ( ) ( ) v 1 ··· v 1 Standard linear blend skinning works as follows: let us ⎜ 1 N ⎟ 4×1 = ⎜ . .. ⎟ denote the i-th rest pose vertex as v˜i ∈ R (with the last A ⎝ . ⎠ ( ) ( ) coordinate equal to 1 as usual), the palette of P affine trans- v F ··· v F ( f ),..., ( f ) ∈ 3×4 1 N formations for frame f as M1 MP R and vertex weights as wi,1,...,wi,P ∈ R. A skinned vertex position in The problem addressed in this paper is to approximate the frame f is then computed as: animation matrix A by skinning with a small number of proxy-bones P. We can obtain useful insights about this P ( f ) ( f ) ( f ) 3×1 v = ∑ w , M v˜ , v ∈ R (1) problem by rewriting Formula (1) in matrix form. If we i i j j i i 3F×4P j=1 stack the skinning parameters in matrices T ∈ R and × X ∈ R4P N as follows: Motivated by skeletal animation terminology, the transfor- ( ) ⎛ ⎞ f (1) (1) ⎛ ⎞ mations M are also sometimes referred to as bones (or M ··· M w , v˜ ··· w , v˜ j ⎜ 1 P ⎟ 1 1 1 N 1 N proxy-bones). The vertex weights w , ,...,w , are usually ⎜ ⎟ i 1 i P T = ⎜ . .. ⎟, X = ⎝ . .. ⎠ required to be convex (i.e. non-negative and summing to 1) ⎝ . ⎠ . (F) (F) ··· w1,Pv˜1 ··· wN,Pv˜N and sparse—a maximum of 4 non-zero weights is a de facto M1 MP c 2010 The Author(s) Journal compilation c 2010 The Eurographics Association and Blackwell Publishing Ltd. Published by Blackwell Publishing, 9600 Garsington Road, Oxford OX4 2DQ, UK and 350 Main Street, Malden, MA 02148, USA. L. Kavan, P.-P. Sloan & C. O’Sullivan / Fast and Efficient Skinning of Animated Meshes SMA, 22 bones (414s) SAD, 22 bones (1512s) Our method,10 and 22 bones ( 22.1 and 22.8s) Original, 5095 vertices Figure 1: Skinning approximation of a skirt animation computed using SMA (Skinning Mesh Animations) [JT05], SAD (Skin- ∗ ning Arbitrary Deformations) [KMD 07] and our proposed method (execution times in brackets). Our method produces more accurate skinning approximations in a fraction of the time required by previous methods (skirt dataset, see Table 2). then Formula (1) can be written in matrix form as: 2. Related Work TX = A (2) The problem of approximating mesh animation with skin- ning was first addressed by James and Twigg [JT05]. For small P, this equation typically cannot be satisfied ex- Their method, called Skinning Mesh Animations (SMA), actly. Therefore, the task is to minimize the Frobenius norm works by applying mean-shift clustering to identify core TX − A for a given number of proxy-bones P. F bone triangles (and thereby bone transformations). Subse- Formula (2) suggests that linear blend skinning can be quently, vertex weights are determined by truncated SVD or also considered as a special kind of matrix decomposition non-negative least squares. The reconstruction quality can (in the following, we will use the term skinning decom- be optionally improved by a corrective technique similar position). The main difference to standard matrix decom- to EigenSkin [KJP02], which works by compressing per- positions, such as the popular Singular Value Decomposi- vertex residuals using truncated SVD. SMAs work best with tion (SVD), is the limit on the number of non-zero ele- models consisting of approximately rigid components (i.e., ments in each column of X (typically 16—four non-zero quasi-articulated), such as human or animal figures. v˜ ∗ weights times four elements of i). Compared to truncated The follow-up work of Kavan and colleagues [KMD 07] SVD [AM00], skinning typically requires more per-frame aims to address the issues associated with highly deformable data, but the amount of per-vertex data is small and fixed. animations. Their method, called Skinning Arbitrary De- The constant number of vertex attributes is probably one of formations (SAD), uniformly distributes proxy-bones over the reasons for the popularity of skinning, as it simplifies the rest pose mesh and optimizes their transformations us- many implementation issues and enables very efficient hard- ing least squares. While this provides more accurate skin- ware processing. ning of highly deformable animations, it is slower than SMA Building on the results of previous work, we introduce a and requires a lot of proxy-bones (typically 100) and Eigen- technique that produces quite accurate skinning decomposi- Skin corrections (typically 10) to achieve visually pleas- tions with low bone counts (see Figure 1). Our method em- ing reconstructions. SAD also produces suboptimal results ploys only standard linear blend skinning without any modi- for quasi-articulated animations, because it does not attempt fications or extensions and is thus suitable for many existing to identify coherent mesh components. Focusing on quasi- applications. However, we do not attempt to organize our articulated animations, Schaefer and Yuksel [SY07]and proxy-bones into a hierarchy (see Figure 2),andwedonot deAguiar and colleagues [dATTS08] develop methods to ex- address the problem of motion post-processing. tract not only the skinning parameters but also full hierar- chical skeletons, thus enabling convenient editing. Both also propose faster clustering methods than mean-shift and alter- native vertex weights optimization methods, but highly de- formable animations (lacking any natural skeletal hierarchy) are not considered. Baran and Popovic[´ BP07]showhowto rig characters using only the rest pose and skeleton, without any training animation. While standard linear blend skinning according to For- mula (1) is the most popular method, several modifications are studied in the literature (we review only the most closely related work, please see [GB08] for a survey). Animation- Figure 2: Example of vertex weights and bone transforma- Space [MMG06a] is a linear skinning technique which re- tions produced by our method. c 2010 The Author(s) Journal compilation c 2010 The Eurographics Association and Blackwell Publishing Ltd. L. Kavan, P.-P. Sloan & C. O’Sullivan / Fast and Efficient Skinning of Animated Meshes laxes the constraints on matrix X from Formula (2)(simi- Feng and colleagues [FKY08] skin highly deformable an- larly to its predecessor Multi-weight Enveloping [WP02]). imations (using an improved SAD procedure) to obtain an The elements of XAnimationSpace can be arbitrary and do efficient posing system based on canonical correlation anal- not have to have the form wi, jv˜i as in standard skinning. ysis. In general, we believe skinning decomposition itself de- However, the sparsity pattern of XAnimationSpace remains un- serves further investigation, as attempted in this paper. changed, i.e., there is a maximum of 16 non-zero elements in each column. The fitting process described in [MMG06a]as- 2.1. Overview of Our Method sumes the bone transformations matrix T to be known (e.g., specified by an animated skeleton). Our main tool for obtaining accurate skinning decomposi- tions is alternating least squares, i.e., a variant of coordinate Clustered PCA [SSK05] can also be considered as ma- descent (proposed in a similar context already in [MG03]). trix decomposition according to Formula (2), but with a dif- In contrast to previous work, we optimize all of the skin- X ferent sparsity pattern—in particular, CPCA is required to ning parameters respectively: bone transformations, vertex T be a rectangular block diagonal matrix (while can be an weights and rest pose positions. Since several iterations are arbitrary dense matrix). On one hand, this allows for more required (we use 15, see Section 5), this results in a lot of flexibility within every single cluster, but on the other hand, least squares problems to be solved, suggesting high compu- every vertex belongs to one cluster only (i.e., the clusters are tational costs. not allowed to overlap). Because of the latter property, the resulting reconstruction may be non-smooth, see Figure 7.