Soft-Body Dynamics Deformable Objects
Total Page:16
File Type:pdf, Size:1020Kb
Deformable Physics Soft-Body Dynamics Deformable Objects A difficult problem Lots of specific solutions but no accepted general best method Applies to: Soft bodies – incl. character animation Destruction Fluid simulation Demo: Pixelux Digital Molecular Matter Used in LucasArts’ "Star Wars: The Force Unleashed". Soft Body Dynamics Visually Realistic physical simulations of motion and properties of deformable objects Shape and topology of objects changes Points within the object move relative to one another However shape has tendency to retain it’s shape to some degree: elastic vs plastic E.g. muscle, fat, hair, plants, clothing and fabric Soft-body Physics Engines Havok Cloth PhysX Bullet Deformation in Graphics Two classes of deformation Geometric deformation Physically based deformation Geometric Deformation Solid Deformations Alan H. Barr, Global and Local Deformations of Solid Primitives, Computer Graphics (Proceedings of SIGGRAPH 84). 18(3), pp. 21-30, 1984. Hierarchical solid modeling transformation of surfaces Locally specified deformation by local/tangent transformation matrices Can be used for e.g. twisting, bending, tapering, … now mainstream Free Form Deformations (FFD) Thomas W. Sederberg, Scott R. Parry, Free-Form Deformation of Solid Geometric Models, Computer Graphics (Proceedings of SIGGRAPH 86). 20(4), pp. 151-160, 1986. Global FFD Local FFD Sabine Coquillart, Extended Free-Form Deformation: A Sculpturing Tool for 3D Geometric FFD Modeling,Computer Graphics (Proceedings of SIGGRAPH 90). 24(4), pp. 187-196, 1990. William M. Hsu, John F. Hughes, Henry Kaufman, FFD Direct manipulation of free-form deformations, Computer Graphics (Proceedings of SIGGRAPH 92). 26(2), pp. 177-184, 1992. Working with control points can be awkward Apply (displacement) constraints directly to surface Karan Singh, Eugene L. Fiume, Wires: A Geometric Deformation Technique, Proceedings Wires of SIGGRAPH 98. pp. 405-414, 1998. Physically Based Deformation Elastically Deformable Models Terzopoulos, D., Platt, J., Barr, A., and Fleischer, K. Elastically Deformable Models, ACM SIGGRAPH 87, 205-214, 1987. Major contribution to physically based deformable models in graphics Lagrangian derivation of eqns of motion r r E(r) f(r,t) t t t t r(a, t): position of particle a at time Net externally applied forces time Net instantaneous potential energy Damping density Mass density of body at a Deformable Object Approaches Solutions from Engineering E.g. Finite element simulation Strive for accuracy Generally very slow Sometimes do not converge to a solution Don’t discern if the visual response is appealing – often provide other kinds of info: Visualization is somewhat different from computer graphics Non-realtime Graphical Solutions E.g. Special effects in movies and commercials Faster solutions, but not fast enough. Animators don’t use techniques if the previews are too expensive. Not as accurate as engineering Focus on Appeal Recent interest in “controllable” simulations Real-time Solutions Resolution Reduction Blobby and coarse look Details disappear Use specialized real-time techniques Physics low-res, appearance hi-res (shader effects) Reduction of dimension from 3d to 2d or 2.5d (height field fluids, BEM) Level of detail (LOD) No equation solving, procedural animation for specific effects Interactive Physics requirements Solutions in Engineering and Off-line animation generally don’t fulfill the requirements of real-time physics Reality methods require: Efficiency Most of the time is going to be used in the rendering process (especially in games). Interactive responses Low latency Visual and haptic minimum frequency constrains Stability Must guarantee stability If the model blows up we lose immersion Realism Interactivity vs. accuracy Plausibility vs. accuracy Taxonomy of Deformable Simulation We can categorise techniques based on: Phenomena they are meant to simulate Formulation of the solution Space Discretization method used Time Discretization methods used Phenomena Being Simulated Elastic objects Plastic objects Fluids Liquids Smoke, clouds fire Cloth Hair Formulation of solution Eulerian reference system attached to the space Lagrangian reference system attached to the object Semi-Lagrangian Space Discretization Mesh based techniques A mesh joins the object nodes Large deformations are hard to simulate (fluids) Object boundary is explicitly calculated Mesh elements: segments, triangles, tetrahedrons, hexahedrons… Example: Mass-spring systems Meshless techniques No explicit mesh connecting particles Difficult to compute the object’s boundary (hard to draw) Suitable for large deformation: like fluids Example: SPH Time Discretization Explicit i1 i i x x v t Current state depends only on past states vi1 vi m1f it Faster Not unconditionally stable Implicit xi1 xi vi1t current state depends on past states vi1 vi m1f i1t and on the current state Requires solving a system of equations Generally slower Adds artificial damping (depending on the object properties) Unconditionally stable Mass-spring Systems Mass-spring Model Body modelled as point masses: masses connected by (weightless) springs Hooke’s Law fof Damped Spring Restoring force fspring kspring(x r) Damping force (for now, lets just use viscous drag - effectively damps oscillation and other motions) fdrag kdragv Basic deformable objects From erleben et al ch 8 Start with newtonian particle system f mx x f / m For a particle system we know the accelerations acting on a particle at any time Assume Explicit Eurler Integration and that time is discretised as ti+1 = h + ti Second order Taylor approximation of position of particle at time ti+1 : xi1 xi x i x i1 x i f(ti ) / m Leads to instability if step-size is too high particle will diverge Not unconditionally stable Verlet Integration Originated in molecular dynamics (central difference approximation: find x based on previous frame and next frame) x(t h) 2x(t) x(t h) h2a(t) A velocity-free formulation (velocity implicitly represented by current and previous positions) in code (store current x and previous x): x = 2*x – x_prev + a *h^2; x_prev = x; not always accurate but fast and stable See; Jakobsen GDC 2001 talk: Advanced Character Physics http://www.floatingorigin.com/mirror/jacobson_01.shtml Cloth Provot. X, “Deformation constraints in a mass-spring model to describe rigid cloth behaviour” Graphics Interface 2001, pp147-154 Springs chosen in a certain structure to model deformable dynamic properties verlet integration An adaptive technique; Dynamic inverse procedure applied to cap deformations for excessive deformation rates More detail on Verlet: http://wapedia.mobi/en/Verlet_integration Mass-spring system for cloth Structural Springs between adjacent particles – resist stretching and compression. Usually relatively high k Shearing Springs connecting diagonal adjacent particles in a regular grid – relatively low k Bending Springs a.k.a flexion springs, prevent sharp ridges when folded: links every second or third particles. Usually very low k for cloth Unstructured Meshes Regular grid is not always applicable For an unstructured mesh: Structural springs correspond to 1-neighbourhood Shearing and bending to a 2-neighbourhood 1 - neighbourhood 2 - neighbourhood Implicit Integration David Baraff, Andrew Witkin The difference in the two methods is that the Large Steps in Cloth Simulation forward method’s step is based solely on Siggraph 1998 conditions at time t0 while the backward http://ai.stanford.edu/~latombe/cs99k/ method’s step is written in terms of conditions at 2000/cloth.pdf the terminus of the step itself.4 Integration Scheme Comparisons http://femto.cs.uiuc.edu/~sbond/code/SpringMass/ Deformable Solids Discretise object into 3d rectilinear grid (voxels) In addition to shearing diagonals we need spatial diagonals that counter volume loss Unstructured solid meshes can be voxelised Mesh points in between grid nodes are updated by trilinear interpolation Muller, M., Teschner, M., and Gross, M. Physically- Based Simulation of Objects Represented by Mesh Surface Meshes. In Proceedings of the Computer coupling Graphics international 2004. Tetrahedral decomposition Split mesh up into tetrahedra Note that interior details are important (not just surface) Delauney tetrahedralization Springs between vertices and 2+ neighbourhoods depending on rigidity http://tetgen.berlios.de/.