Non-Uniform Bone Scaling From Art Pipeline to Real-Time Rendering.

Slides:



Advertisements
Similar presentations
Today Composing transformations 3D Transformations
Advertisements

Animation in Video Games presented by Jason Gregory
COMPUTER GRAPHICS 2D TRANSFORMATIONS.
This terms course Last term we both worked on learning 2 things –Processing –The concepts of graphics etc. This term will focus more on the basic concepts.
Computer Graphics Lecture 4 Geometry & Transformations.
Arbitrary Rotations in 3D Lecture 18 Wed, Oct 8, 2003.
1 ME 302 DYNAMICS OF MACHINERY Dynamic Force Analysis IV Dr. Sadettin KAPUCU © 2007 Sadettin Kapucu.
3D Graphics for Game Programming (J. Han) Chapter XI Character Animation.
Lecture 2: linear algebra, animation basics
Informationsteknologi Wednesday, November 7, 2007Computer Graphics - Class 51 Today’s class Geometric objects and transformations.
1 Computer Graphics Week6 –Basic Transformations- Translation & Scaling.
HCI 530 : Seminar (HCI) Damian Schofield. HCI 530: Seminar (HCI) Transforms –Two Dimensional –Three Dimensional The Graphics Pipeline.
Computer Graphics (Fall 2008) COMS 4160, Lecture 3: Transformations 1
Computer Graphics (Fall 2004) COMS 4160, Lecture 3: Transformations 1
Week 4 Lecture 3: Character Animation Based on Interactive Computer Graphics (Angel) - Chapter 10 1 Angel: Interactive Computer Graphics 5E © Addison-Wesley.
Computer Graphics (Fall 2005) COMS 4160, Lecture 2: Review of Basic Math
CSE 473 Dr. Charles B. Owen Fundamentals of 3D Game Development1 Skeletons and Skinning Bones and Skeletons Mesh Skinning.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology 3D Engines and Scene Graphs Spring 2012.
Table of Contents Matrices - Inverse of a 2  2 Matrix To find the inverse of a 2  2 matrix, use the following pattern. Let matrix A be given by... Then.
Week 4 - Monday.  What did we talk about last time?  Vectors.
2IV60 Computer graphics set 4:3D transformations and hierarchical modeling Jack van Wijk TU/e.
CS 450: COMPUTER GRAPHICS 3D TRANSFORMATIONS SPRING 2015 DR. MICHAEL J. REALE.
Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 2: Review of Basic Math
Chapter 5.2 Character Animation. CS Overview Fundamental Concepts Animation Storage Playing Animations Blending Animations Motion Extraction Mesh.
Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 3: Transformations 1
COS 397 Computer Graphics Svetla Boytcheva AUBG, Spring 2013.
2.2 Linear Transformations in Geometry For an animation of this topic visit
Computer Graphics Group Tobias Weyand Mesh-Based Inverse Kinematics Sumner et al 2005 presented by Tobias Weyand.
Geometric Transformation. So far…. We have been discussing the basic elements of geometric programming. We have discussed points, vectors and their operations.
CS 450: COMPUTER GRAPHICS QUATERNIONS SPRING 2015 DR. MICHAEL J. REALE.
Chi-Cheng Lin, Winona State University CS430 Computer Graphics Transformations of Objects – 2D Part I.
CSE 681 Review: Transformations. CSE 681 Transformations Modeling transformations build complex models by positioning (transforming) simple components.
Week 5 - Wednesday.  What did we talk about last time?  Project 2  Normal transforms  Euler angles  Quaternions.
1 CO Games Concepts Week 20 Matrices continued Gareth Bellaby.
2.2 Day 2 Reflections and Rotations combined with Scaling The concept of transformations inspired art by M.C. Escher.
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
Maths & Technologies for Games Animation: Practicalities CO3303 Week 3.
Matthew Christian. About Me Introduction to Linear Algebra Vectors Matrices Quaternions Links.
CS 325 Introduction to Computer Graphics 02 / 26 / 2010 Instructor: Michael Eckmann.
CS559: Computer Graphics Lecture 8: Warping, Morphing, 3D Transformation Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
Computer Graphics 3D Transformations. Translation.
Direct3D Workshop November 17, 2005 Workshop by Geoff Cagle Presented by Players 2 Professionals.
Computer Graphics Matrix Hierarchies / Animation
Animation CS418 Computer Graphics John C. Hart.
CAP 4703 Computer Graphic Methods Prof. Roy Levow Chapter 9.
COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS D Geometric Transformations Graphics Systems.
January 19, y X Z Translations Objects are usually defined relative to their own coordinate system. We can translate points in space to new positions.
Lecture 5: Introduction to 3D
Foundations of Computer Graphics (Spring 2012) CS 184, Lecture 3: Transformations 1
Graphics Lecture 2: Slide 1 Lecture 2 Transformations for animation.
Inverse Kinematics CSIS 5838: Graphics and Animation for Gaming.
Week 5 - Monday.  What did we talk about last time?  Lines and planes  Trigonometry  Transforms  Affine transforms  Rotation  Scaling  Shearing.
2014 Animation Programming for Music Video Games Jessica Scott Harmonix Music Systems, Inc. October 10, 2014 #GHC
Computer Graphic 2 D Transformation.
CGDD 4003 Character Animation. The Skeletal Hierarchy (aka the “rig”) Based on the concept of bones Each bone has exactly one parent Each bone has a transform.
CSE 167 [Win 17], Lecture 2: Review of Basic Math Ravi Ramamoorthi
Object-Orientated Analysis, Design and Programming
CSE 167 [Win 17], Lecture 3: Transformations 1 Ravi Ramamoorthi
Software Engineering and Game Development
Computer Graphics 3D Transformations
3D Geometric Transformations
Bones Skeletal Unity-2D How & When
Dynamic Array Multidimensional Array Matric Operation with Array
COMP 175: Computer Graphics February 9, 2016
Skeletons and Skinning
GAM 325/425: Applied 3D Geometry
Chapter XIII Character Animation
Inverse & Identity MATRICES Last Updated: October 12, 2005.
Computer Graphics Matrix Hierarchies / Animation
Presentation transcript:

Non-Uniform Bone Scaling From Art Pipeline to Real-Time Rendering

Why Non-Uniform Bone Scaling?

Different Forms of Scaling: The illustration on the right displays the different ways scales can be applied to a transformation matrix. Scaling illustrated in pictures 2-4 can be achieved using a ‘regular‘ transformation matrix with only ‘Position‘, ‘Rotate‘ and ‘Scale‘ components. Picture 5 illustrates a form of scaling that can only be achieved by introducing a ‘Stretch Quaternion‘ as a component to the transformation matrix. 1. No Scale:2. Uniform Scale: 3. Y-Axis Scale: 4. X-Axis Scale: 5. Arbitrary Non-Uniform Scale:

Stretch Quaternion The stretch quaternion defines how the object is rotated before the scale component gets applied to the transformation matrix. The following illustration shows how a non- uniform scale is applied: 1. Apply inverse stretch quaternion 2. Apply scale 3. Apply stretch quaternion 4. Apply rotation 5. Apply position

How to Extract the Data 1.For each bone of each frame of animation in the 3D application (3DS Max, Maya, etc.), get the transformation matrix 2.Run decomp_affine ("Polar Matrix Decomposition" by Ken Shoemake, in "Graphics Gems IV”) on these matrices and check if stretch quaternion is identity. 3.If stretch quaternion is not identity, mark the bone for this animation as non-uniformly scaled. 4.Store all frames in the animation as you would normally, but also store the stretch quaternion data for all non-uniformly scaled bones as marked in step 3.

How to Reconstruct the Data Code for recomposing of the final matrix from its components: Matrix FinalMatrix; if(CurrentBone.StretchQuat) { Matrix PosMtx.FromTranslation(PosVector);// sets 4th row Matrix ScaleMtx.FromScale(ScaleVector);// sets scale entries Matrix RotMtx.FromQuaternion(RotQuat);// quaternion to matrix Matrix StrMtx.FromQuaternion(StretchQuat);// quaternion to matrix Matrix InvStrMtx.Inverse(StrMtx);// inverse of matrix FinalMatrix = InvStrMtx * ScaleMtx * StrMtx * RotMtx * PosMtx; } else { Matrix PosMtx.FromTranslation(PosVector);// sets 4th row Matrix ScaleMtx.FromScale(ScaleVector);// sets scale entries Matrix RotMtx.FromQuaternion(RotQuat);// quaternion to matrix FinalMatrix = ScaleMtx * RotMtx * PosMtx; } As you can see, the performance is only impacted for bones that do stretch in a non- uniform way. Therefore, additional storage of the stretch quaternion component data is only required for these types of bones.

So, that‘s why!

Scale Inheritance Problem When traversing a skeleton, each child bone by default inherits the parent bones scale value. This can lead to problems when applying non-uniform bone scaling to a bone that has children. The children will most likely be affected by an undesired (sheared) scale component. 3D modelling programs such as 3DS Max, Maya, etc., therefore provide a per bone ‘Don‘t inherit scale‘ option. This data needs to be exported, stored with your animation data, and respected by the game engine for the animations to look correct. Not respecting these flags will result in wrongly sheared animations.

Scale Inheritance You Say?

Respecting Scale Inheritance Flag at Run-Time Traverse the skeleton and compute bone matrices using ONLY the position and rotation components. Store the resulting bone matrices twice. Traverse the skeleton again to compute and add the scale components to only the second set of matrices. Do a final pass on the scaled skeleton (second set of matrices) to compute the posed bone matrices with one rule: If the „Don‘t inherit scale“ flag is set, then look up the parent matrix from the unscaled set of matrices, otherwise use the parent matrix from the scaled version.

Aha! Scale Inheritance!

Thank you! Special thanks to the owners of Incinerator Studios and THQ for letting me use their content. Special thanks to Mike Howard and Nikita Wong for creating the animations. Special thanks to Michael Seare and Shaun McIntyre, my collaborators. Special thanks to Ken Shoemake for decomp_affine (Google it if you want to use it.) For questions I can be reached at: