42
13: DEFORMABLE OBJECT SIMULATION 10/03/2015 10/03/2016 CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

13: DEFORMABLE OBJECT SIMULATION · 8 MAIN CHALLENGES Fewer global assumptions means limited pre-computation E.g. Centre-of Mass, Inertia Tensor, Dynamics Proxies More complex and

Embed Size (px)

Citation preview

13: DEFORMABLE OBJECT SIMULATION10/03/2015

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

2 DEFORMABLE OBJECTS

Generalization of rigid body physics

Soft bodies e.g. plastic/elastic deformations, character animation

Fracture and destruction

Fluid simulation e.g. liquids, gases

Still an open problem:

Lots of specific solutions

No single accepted general best method

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

APPLICATIONS

4 DEFORMATIONS IN PHYSICS ENGINES

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

5 PHYSICS IN UNREAL ENGINE 3“POWERED BY NVIDIA PHYSX”

See: http://www.unrealengine.com/features/physics/GDC 2008 Tech Demo: http://www.youtube.com/watch?v=-m4pe6UAS2M

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

6 PHYSICS IN CRY ENGINE 3

GDC 2010 Tech Demo (from gametrailers):http://www.gametrailers.com/video/gdc-10-cryengine-3/63096

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

7 GTC 2010: PHYSICS FLUID SIMULATION

Physics Demo Shows Off Water Simulation on 1 GPU - GTC 2010 http://www.youtube.com/watch?v=1JrM4ujLY_AHybrid solver, based on heightfiled fluids and particles

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

8 MAIN CHALLENGES

Fewer global assumptions means limited pre-computation

E.g. Centre-of Mass, Inertia Tensor, Dynamics Proxies

More complex and lower level data structures

Larger dependence on geometry

Local vs. global models of object behaviour

Higher dimensional equations of motion: PDE’s vs ODE’s

More issues of stability

Computationally more expensive

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

9 SOLUTIONS FROM ENGINEERING

Typically finite element analysis

Strive for accuracy

Generally very slow

Sometimes do not converge to a solution

Driven to provide information rather than appeal

Visualization as opposed to computer graphics

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

10 SOLUTIONS FROM ANIMATION

e.g. Special effects in movies and commercials

Focus on appeal: accuracy not as crucial as in engineering

Faster solutions than engineering, but driven more by complexity than interactivity

Although there is increasing demand for proto-type “previs”

Often require “directable” simulations

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

11 KEY REQUIREMENTS OF REAL-TIME PHYSICS

Efficiency:

Interactive responses required Low latency: Minimum frequency constraints: Visual (20fps) and haptic (1kHz) N.B. Most of the time used in the rendering process (especially in games).

Also resource (e.g. Memory) and power efficiency

Stability:

Should guarantee robustness: unsupervised simulation process If the model blows up we lose immersion

Simplicity

Ease of implementation Resource availability reproducability

Realism:

Plausibility vs. accuracy Interactivity vs. accuracy

contrary to the belief that performance is the single overriding factor in the evaluation of research by game developers, the most important factors are, in this order:1.robustness2.simplicity3.Performance- Chris Hecker “A Game Developer’s Wish List for Researchers”http://chrishecker.com/A_Game_Developer%27s_Wish_List_for_Researchers

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

12 REAL-TIME SOLUTIONS

Possible strategy: Resolution Reduction

Blobby and coarse look

Details disappear

Use specialized real-time techniques

Physics low-res, appearance hi-res

Dimension Reduction

e.g. from 3d to 2d or 2.5d (height field fluids, BEM)

Level of detail (LOD)

Canned/procedural animation for specific effects

© Kim et al , Cornell

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

13 DEFORMABLE SIMULATION TECHNIQUES

Rigid Body Dynamics is almost completely solved

However there are MANY alternatives for deformable objects

Different systems cater for specific application

None can easily be considered better than others

We can categorise techniques based on:

Type of phenomena they simulate

Formulation of the solution

Space Discretization method

Time Discretization method

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

14 TYPE OF PHENOMENA

Plastic Deformation Elasticity Fracture Sound

Gases Liquids Cloth Hair

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

15 FORMULATION OF SOLUTION

Lagrangian: reference system attached to the object

Eulerian: reference system attached to the space

Semi-LagrangianLeft & Middle Images © 2009, Michael J. Gourlay

Right Image © 2012 Andrade et al

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

16 SPACE DISCRETIZATION

Mesh based techniques e.g. Mass-spring systems A mesh joins the object nodes Mesh elements: segments, triangles, tetrahedrons,

hexahedrons… Object geometry/boundary is explicitly calculated Large deformations are hard to simulate (e.g. fluids)

Meshless techniques e.g. level set techniques, implicit models No explicit mesh connecting particles Difficult to compute the object’s boundary (hard to

draw)

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

17 TIME DISCRETIZATION

Explicit

Current state depends only on past states

Faster

Not unconditionally stable

Implicit

current state depends on past states

… and on the current state

Requires solving a system of equations

Generally slower

Unconditionally stable

tmt

1i1i1i

1ii1i

fvvvxx

tmt

i1i1i

ii1i

fvvvxx

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

MODELLING DEFORMATIONS

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

19 SOFT BODY DYNAMICS

Visually Realistic physical simulations of motion and properties of deformable solids

Shape and/or topology of objects changes

Points within the object move relative to one another

Solids have tendency to retain their shape to some degree

elastic vs plastic deformations

Examples:

Shape deformations: muscle, fat, hair, plants, clothing and fabric

Also partially deformable objects: no change in topology

Skinned hierarchies

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

20 GEOMETRIC DEFORMATIONS

Locally specified deformation by local/tangent transformations

Can be used for e.g. twisting, bending, tapering

now mainstream in modelling tools e.g. 3DS Max

Alan H. Barr, Global and Local Deformations of Solid Primitives, Computer Graphics (Proceedings of SIGGRAPH 84). 18(3), pp. 21-30, 1984.

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

21 FREE FORM DEFORMATIONS (FFD)

Object is placed in a hull. Deformations to the control points of the hull propagate changes in the shape of the underlying object.

[Sederberg86]

[Sederberg86] Thomas W. Sederberg, Scott R. Parry, Free-Form Deformation of Solid Geometric Models, SIGGRAPH 86. 151-160, 1986.

[Coquillart90] Sabine Coquillart, Extended Free-Form Deformation: A Sculpturing Tool for 3D Geometric Modeling, SIGGRAPH 90, 1990.

[Coquillart90]

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

22 DIRECT MANIPULATION FFD

Working with control points can be awkward

Apply (displacement) constraints directly to surface

[Hsu92] William M. Hsu, John F. Hughes, Henry Kaufman, Direct manipulation of free-form deformations, Computer Graphics (Proceedings of SIGGRAPH 92). 26(2), pp. 177-184, 1992.

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

23 PHYSICALLY BASED MODELS

Seminal work on physically based deformable models in graphics

Lagrangian derivation of eqns of motion for a particle on an object

),()( trt

Ettt

frrr

Where …., ): position of particle at time

:Mass density of body at :Net instantaneous potential energy:Damping density:Net externally applied forces

[Terzopoulous87] Terzopoulos, D., Platt, J., Barr, A., and Fleischer, K.Elastically Deformable Models, ACM SIGGRAPH 87, 205-214, 1987.

Inertial Force Damping Force Elastic Force due to deformation from rest shape

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

DEFORMABLE SIMULATION: COMMON PRINCIPLES

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

25 DEFORMABLE PROPERTIES

Stress: within a solid object is the magnitude of force applied on an object divided by the surface area over which it acts

Strain: the fractional deformation caused by stress

Elasticity: Tendency of a body to return to its original shape after the forces causing deformation are removed

Opposite of plasticity: tendency to undergo permanent deformation due to forces

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

26 MEASURING DEFORMATIONS

An object in its equilibrium configuration defined as a connected subset of points

.

Coordinates ∈ of a point on the object are called material co-ordinatesof the point

When object deforms, points move to , the spatial world co-ordinates of a

point

We can represent displacement vectors:

defines a displacement field

(x,y,z) p(x,y,z)

Deform geometry from its original configuration

u

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

27 MEASURING DEFORMATIONS

Rotation and translation are solid movements and not deformations –spatially constant displacement field

Relative movement of point with respect to its neighbours

In 3D, the displacement function has 3 components, , , , , , , ,

Natural Shape Rigid Body Motion –Zero Energy

Small Deformation – Low Energy

Large Deformation – High Energy

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

28 STRAIN

The relative elongation (or compression) of a material

A magnitude to measure deformation

A function of the displacement field

Derived from the spatial variation or spatial derivatives of the displacement field

Note

Strain may vary across different points in a body

a point getting compressed in one direction may be depressed in another

Strain cannot be expressed as a single scalar but by a symmetric 3x3 matrix:

stretched

compressed

Diagonal describes stretchOff-diagonals: shear

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

29 STRAIN IN 3D

In 3D, the displacement function has 3 components

, , , , , , , ,

Note that a point getting compressed in one direction may be depressed in another

Strain cannot be expressed as a single scalar but by a symmetric 3x3 matrix:

Diagonal describes stretchOff-diagonals: shear

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

30 STRAIN IN 3D

Strain tensor

Non linear tensor

Green tensor:

Invariant to rigid body motions

Linear tensor

Cauchy strain tensor

Invariant to translations

Not invariant to rotations!!!

Linearization of Green Strain

Where Gradient of displacement field:

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

31 STRAIN IN 3D

Green strain tensor vs. Cauchy strain tensor

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

32 STRESSDescribes forces acting inside object

Stress is defined as a force per unit area:

As with strain, represented by a 3x3 stress matrix:

We’re interested in the ratio of stress to strain

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

33 LINEAR STRAIN

A force F acts on a wire with cross-sectional radius

If ∆ is change in length

Young’s modulus ( ) gives the ratio of stress to strain

A.k.a Elasticity Tensor

Units: /

/∆ /

This is really Hooke’s Law: Extension of spring is proportional to force acting on it

L L

AC

F

(From wikipedia)

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

34 SHEAR MODULUS

F

/∆ /

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

35 BULK MODULUS

VVP

strainvolumestressvolumeK

/

where is pressure

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

36 POISSON RATIO

For homogeneous isotropic materials E, G, K are related by:

2 1 3 1 2

where (Poisson's ratio for the material) gives the relationship between expansion and compression of a particular material

Poisson Effect: a body compressed in one direction tends to expand in the other two directions

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

37 MASS-SPRING SYSTEM

Model objects with particles

Particle masses at vertices Springs on edges connecting vertices Use topology of springs to approximate

stress/strain E.g. hair (1-d), cloth (2-d), volumetric solids

(3-d tetrahedra)

Disadvantages: Springs represent lines not volumes Difficult to match real-world physical properties Unrealistic behaviours: lack of volume preservation,

inversion, unrealistic shearingImages © Francois Faure & © Ron Fedkiw

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

38 CONTINUUM MECHANICS

Branch of physics that studies the behavior of materials modeled as a continuum Continuum implies a continuous mass (with varying properties) as

opposed to discrete particles

Applicable to… Solids: There exists some equilibrium

state/rest position for the body Characterised by Stress, Strain,

Elasticity / Plasticity Fluids: Characterised by Stress/Strain

(for Newtonian fluids),Viscosity Image from wikipedia

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

39 FINITE ELEMENT SIMULATION

A popular technique in physics and engineering: Objects are modelled as a three-dimensional elastic continuum

Break object into a large number of solid elements

which fit together,

Solve partial differential equations for the stresses

and strains in each element

http://www.cotsjournalonline.com/articles/view/100781Pixelux use a finite-element-based approach for DMM

Image © Zhi Dong

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

40 CONTINUUM MECHANICS

What we need to solve is the momentum equation for a finite element within a continuum

Given a continuous function : THE DISPLACEMENT OF A POINT

Calculate internal body forces per unit volume based on stress

and strain

The equation of motion for soft bodies is:

Solve for

Notes From Müller et al 2007: SIGGRAPH Course Notes on “Real-time Physics”Images left: © BeamNG, Others © Ron Fedkiw

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

41 REQUIRED READING

Mueller, M,. James, D., Thuerey, N. and Stam, J. Real-time Physics SIGGRAPH 2008 Course Notes

Available at: http://www.matthiasmueller.info/realtimephysics/

The following sections relevant to this lecture (we’ll look at some of the others later)

Chapter 4, sec 4.1 (Continuum Mechanics)

Chapter 2 (Introduction to Solids)

The first part of Mueller’s Siggraph tutorial talk (about 40 mins) available as a video: http://www.scss.tcd.ie/John.Dingliana/cs7057/mullertalk.mov

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE

42 MODULE PLAN FOR REMAINING WEEKS

Monday Thursday

Week 8 Assignment 4&5 Lecture

Week 9 Meetings St. Patrick’s Day

Week 10 Meetings [Mandatory]- Schedule to be confirmed Lecture

Week 11 Lecture Lecture

Week 12 Assignment 6 Demos

Assignment 6 Requirements

Confirm choice of paper 16/03/2016 @ 5pm Send me 1 slide or 1 page doc by 18/03/2015 @ 5pm Plan for implementation + summary of progress

Update meeting 21/03 : Mandatory attendance; schedule TBC Final demos 6/04/2014 2pm to 5pm; schedule and venue TBC

10/03/2016CS7057: REALTIME PHYSICS (2015-16) - JOHN DINGLIANA PRESENTED BY MICHAEL MANZKE