730 likes | 949 Views
New simulation algorithm and architecture for Game Physics. Michael Lin President & CEO Reality Matrix Inc. michael@reality-matrix.com. What we will be going through?. Algorithm Combine the rigid-body and deformable body dynamics all together. Parallel able and distributable algorithm
E N D
New simulation algorithm and architecture for Game Physics Michael LinPresident & CEOReality Matrix Inc. michael@reality-matrix.com
What we will be going through? • Algorithm • Combine the rigid-body and deformable body dynamics all together. • Parallel able and distributable algorithm • Industry level computational continuum algorithm • Compare to FEM, traditional explicit FEM • Simple, Fast, and Accuracy • Architecture • Vector form of physics architecture, from concept to modeling • Extensible architecture • How we can do that? • Using the new algorithm from new concept!
Targets on this presentation • Rigid body V.S. Deformable body • Major applications for Game or 3D VR • Cloth Simulation, Deformable Body Simulation…etc • Behavior of Collided Bodies, Impacted Effects • Major points of considerations • Material properties introduce the difference of deformation • Object colliding behavior influenced by impact factors, e.g. high-speed or the shape of penetration • No real rigid body in the world! • It’s only the thing that has high stiffness material properties!
Algorithm and Architecture • Concept -> Mathematical Modeling -> Algorithm -> Programming architecture • Concept • Newtonian, Objects forms from particles • Deformation caused by rigid body motion • Mathematical Modeling • Only consider the numerical modeling, no exact solution included! • Algorithm • Explicit integration causes the simple computational architecture • Programming Architecture • Based on simple architecture to the parallable and extensible programming architecture
Review on traditional methods • The particle-spring modeling • The simplest, widely used in the game industry • The spring or spring-damper modeling that can not fully described the material internal forces. • FEM, The Finite Element Method • It is based on small deformation assumption and variational method. • It costs time to days and large memory requirement by its matrix solving process. High programming complexities. • It may not convergence and cause errors. • BEM, The Boundary Element Method • By using the Green’s function, it’s faster then FEM. • It’s difficult to prepare the preprocessing data and not easy to apply. • DEM, The Discrete Element Method • It change the particle-spring model to use the rigid-body-spring model. • It also can not fully described the internal force of material in the deformation process.
Key Concepts • No nonlinearity at all, we solve the nonlinear of material and nonlinear of geometry in a linear way! • Newtonian, Balancing forces, and Principle of Virtual Work • How we can convert the deformations to rigid-body kinematics modeling? • Large deformation = Rigid-Body Motion + Small Deformation • Object comes from particles, and deformation of body comes from particle movements. • Internal forces of the body comes from small deformation, not related to the rigid motion.
Mathematics Modeling • Explicit time integration causes the simple, time stepping and real-time architecture. • By using balancing (Virtual works, variation) method, we can solve the distribution of internal forces. • Simple equilibrium math, causes the fundamental of soluble numerical model. • We can solve the small deformation of object by the rigid motions.
Algorithm • Causing the simplicity of mathematical modeling, we can describe versatile of systems, including rigid-bodies, deformable bodies; there're solid and fluid simulation. • Causing the simplicity of mathematical modeling, we can integrate it into other algorithms. • The new algorithm is not including traditional abilities, also support the advanced simulation ability. • Parallel algorithm based on the simplicity. • The algorithm combines the different stages of rigid-body motion, deformation process and fracture simulation.
Our knowledge base • Rigid-Body Kinematics and Dynamics • To compute the particle movement • The Finite Element Method • To compute the piece of body’s internal forces (cohesion forces) • Numerical Integration Method • To compute the stepping of displacement, to form the trend of body movements. • We can use implicit or explicit integration method. But the explicit method causes the simple programming architecture. • Explicit algorithm causes the vector form of programming architecture.
Our key technology – Zigma • Modeling of algorithm and mechanical math modeling. • The estimate method of the rigid-body movement. • Estimate the internal forces in the body more accuracy. • We use the incorrect explicit integration method to become the self-equilibrium system. • The vector architecture forms the foundation of parallelism.
A Review on Game Physics Approaches • A rigid body type description • Matrix form, describe the whole object • Using 3x4 float points • A mesh type description • Vertex type description, for each vertex • For deformable body
Rigid Body • A rigid body – by Newton • “A continuum can be defined by a group of particles, they connected to each other.” • the rigid-body type description, cannot to describe the deformable body movement.
Deformable body • why do we need a “deformable body”? • In the latest game, the existence of deformable body is everywhere. Just like the real world we lived, that’s only the “deformable” body. The rigid-body actually does not really exist in the world. • All about the cloth system, wave and water effects, they’re everywhere. Even we can use the vertex shader technology, it is an operation about the mesh level or using the particle method. That’s different from rigid body descriptions.
The finite element method • In fact, in the engineering field, let go back 1970, people develop the finite element method to solve the deformable body simulations, in actually words we say, structure analysis. • From now, we have saw many faces and keywords, continuity, non-continuity, rigid-body, deformable body, they seems troublesome. Actually, we will put all together in our algorithm in below.
What’s the difficulty about the FEM in game industry? • A problem about the consuming of the computational power • A problem about the memory consuming • Finite element method is based on small deformation assumption. • In the small deformation assumptions, the finite element method has its difficulties on analysis the large deformation about bodies, including cloth or fracture phenomenon.
Deformation • Deformation, in mechanics analysis, we usually separate it into large deformation and small deformation analysis. • In the small deformation assumptions, the finite element method has its difficulties on analysis the large deformation about bodies, including cloth or fracture phenomenon. • Because the clothing problem, itself a large deformation process. In mechanics, it’s a nonlinear problem. The nonlinearity will be included geometry and material nonlinearity.
Material Modeling • Hook’s law: • (dF) = (k)(dX) • it is the basic concept of the constitutive law in material mechanics. That describes the stress-strain relationships. • The material will cause the permanent deformation and fluid type; it will need the complex mathematics and physics modeling. They are usual described of partial differential equations.
An introduction to a game physics algorithm • The modeling is similar to the classical approaches used in structures and mechanical vibrations. The physical concept is easy to incorporate with other physical phenomena. • The computer codes are small and simple. • The algorithm is straightforward. Special numerical techniques are not required.
Why we don’t use traditional FEM? • The computing power of finite element is too huge, it’s unable to use in the real time gaming purpose. • The finite element is using the matrix solving techniques to expand its domain; it can not be applied on limited memory storage console platforms. • The basic is that the finite element is based on SMALL-DEFORMATION. So it naturally can not be applied to large deformation calculations. We’ll describe that below. • The finite element method is can not to handle the fracture problem in nature, because it needs the continuity about an element. • Of course, most of the finite element codes have been adopted into parallel forms on super computers. But naturally it is a matrix form solving problem, if we can use the vector type algorithm, then it will take the most advantage in modern vector accelerated chips.
Explicit finite element method • The explicit finite element method its since 1970, from the national laboratory in Livermore and Argon. It is widely used on nuclear simulation and reactor safety simulations. It is most widely used on explosion and penetration topics. It is so-called “transient finite element analysis” or “explicit finite element analysis”. • We adopted it into the game industry for several years’ research. • Something was wrong in traditional explicit finite element method, we will prove that in below.
Our approach – Intrinsic Vector form FEM • Compute the motion and deformation due to the application of non-equilibrium external forces. Mathematically, it can solve displacement, force or mixed boundary value problems. The essential boundary conditions do not have to be prescribed. • Handle multiple continuous bodies and their interactions. • Handle body fragmentation or merger based on prescribed failure criteria. • Compute crack initiation, and crack propagation in a continuous body. • Compute very large deformation. • Handle complicated, inelastic, or discontinuous material properties. • Compute transient response. With a slowly applied force or a dynamic relaxation process, obtain quasi-static response.
Matrix form and Vector form • Matrix form is highly coupled. That means it is a sequence about the row and column operations. Instead of the matrix architecture, purely vector form is very easy to use the hardware and software acceleration features to improve the solving speed. • The matrix method widely knows is related to the level of square. In the common language in physics, that is dependent on the degree of freedom. • The vector form solving architecture, it just grows in linear with the degree of freedom. This is benefit for memory consuming issue.
Zigma Technology • The Zigma technology, or by its neutrality, we call it “vector form intrinsic finite element analysis. • Our demands • First, it deals with a lot of continuous body combine with rigid body movements and they can interact with each other. • Second, it deals with the non-linearity and discontinuous material effectively. • Third, it deals with the geometry deformation about the continuum.
Target • This approach can be stable to handling the basic problem from one continuum into multiple continua. • Handling the large rigid-body motion and deformation at the same time • Handling the unbalance forces work corresponding to the rigid body motion • Handling the complex material properties modeling • Handling single continua into multiple bodies • Handling the single continuum interact to other bodies • Handling the unbalance forces • Calculating the deformation precisely, that means handle the deformation in large rotation • Avoiding the iterations
Nonlinear continuum mechanics • The real object has obviously geometric deformation while destroy and cracking. • Nonlinear continuum mechanics once have deeper discussion to the large deformation theory such as Malvern. • To apply the nonlinear continuum mechanics to the large deformation process, it brings a lot of restriction from the initial shape definition.
Current form and Init form • Because in practices problems, the real time shape and the initial shape usually has great difference. At the same time, some mathematics requirements may not be satisfied, something like the positive defines about the matrix. • We noticed that in some literatures about the large deformation analysis, like the elastica problems and rubber elasticity problems, they most add the moderately large deformation assumptions.
Large displacement & deformation • In finite element analysis, large displacement and large deformation is a subject paid attention. • When the practical problems involving the complicated object geometry and changes about the material properties, the algorithms mostly use the iterative method to solve such problems.
Our idea • To set up a practically algorithm that can predict the object is destroyed and cracking, it should not be limited with the amount of the deformation and displacement. • Meanwhile, it should be stable and precisely to obtain the results. On such basis, we adopted some explicit algorithms to a new simulation algorithm and concepts. • Use the current form as the basic frame to define the incremental stress and incremental strain. We also use the incremental constitutive law.
accuracy • For an elastic body is passing through the moderate or similar to the initial form deformation process, it might not be so complete and accuracy as the total analysis. • Because the error occurs in each incremental calculation, and its accumulated.
Our approach • the vector form of equation of motion • explicit time integration • the co-rotational coordinate method to separate the rigid body motion and deformation • the moving convected coordinate method to handling the large deformation and large displacement parts. • We don’t have the variational form in our approach and also don’t use the partial differential equation by the expression about the stress.
Our approach • It deal with a lot of continua and combine with rigid body and they interact with each other. • It deal with the nonlinearity and discontinuous material effectively. • It deal with the geometry deformation of the continuum.
Displacement and Deformation • Since the continuum is deformable, the procedure needs to handle the rigid body movement and deformation at the same time. • The rigid body displacement can be far greater than deformation.
The moving convected coordinate architecture • definition about the strain, stress and virtual works • It derives an incremental process to calculate the large displace and large deformation movement.
Our idea • Adopt the incremental calculation: to setup an explicit deformation procedure. In this procedure, avoid to use the iterations. • Use the current form as the basic frame to define the incremental stress and incremental strain. We will also use the incremental constitutive law.
Co-rotational coordinate approach • We assumed that there’s fixed global frame and a co-rotational frame fowling the element rotated and translated. • We can describe any displacement of a point within the element as two parts:
Large displacement • However, we can prove that, when the large displacement causes the object with large rotations, the traditional co-rotation method is lake of the accuracy. So if it does not add the improvement, it is only suitable for limited large displacement motions. • Second, the co-rotational method seems unsuitable for two or three dimensional problems. • This is because the large displacement and large deformation usually happens simultaneously in a continuum. The simplify modeling is not suitable for small deformation adding on large rigid body movements.
The basic assumptions and discretization • We consider a body: It is composed by multiple rigid bodies and deformable continua. • When the body is applied by external forces, each body will change their direction and position, and might change their geometry shape. • Some of them will collide each other or assemble to a new continuum. For any one of them, it might be separated into more individuals too.
Equations of motion • Equations of motion • is the reaction force vector that is the external force. • is the resistance force vector comes from the a continuum media around α particle, that is global internal force vector.
The commonly used method of discretization is that we divide a continuum in to several proper sub-regions that is also elements. • However, the rule of division is arbitrary in theoretically. So the particle and the node should not be in the same place.
Element analysis • For each element, they don’t have mass property so itself satisfy the static equilibrium. • are the internal forces acting on elements or nodes that are the element internal nodal forces. • In traditional finite element analysis, we can define the nodal forces by the virtual work principle. That is
The summation about the global nodal internal forces acting on each node is sum of element nodal internal forces. • In the same way, we can process the definition about the element external forces in the same way as follows: • is the external force vector on alpha node of k element.
FEM Shape function • When we calculate the virtual work δ, we can use the traditional finite element method. • The function N satisfy the basic continuity requirement and on the boundary of element.
the virtual external work • According to d'Alembert theory, we consider the virtual external work for each element by the inertia forces, • is the nodal mass for alpha element.
Summarize • On the node, the motion of the particle satisfy: • Within the element, the internal nodal forces satisfy: • And the displacement vector satisfy the Cn-continuity. • On the boundary surfaces, force and displacement satisfy the boundary conditions. • On the contact surfaces, force and displacement satisfy the collision conditions or the continuity condition.
Some conclusions • This algorithm about the bodies basically simulates a limited number of particles. This is different from traditional finite element method that needs the system equilibrium. • The absolute displacement of the objects nodes comes from the equations of motion. The displacement on each object’s displacement is the same so the continuity condition is satisfied between the elements. • This approach we purposed introduces the co-rotational method to separate the rigid body displacement by deformation displacement.
Time integration – Explicit or Implicit methods • We use explicit time integration, that is convenient for handling the non-elastic and non-continues material properties. • It is avoid the iterations in solving the equations of motion. • However, the basic theory on finite element is not limit to explicit time integration methods. Other time integration methods, like Newmark-beta implicit time integration method, is suitable to solve the equations of motion.
Vector form FEM • According the Newton’s basic assumption, we define a continuum as a group of particle mass assemblage. So the finite element calculation is to formulate a set of vector equation. • Adopting the explicit time integration method to solve the particle motion. • Adopting the co-rotational frame architecture to resolute the rigid body displacement and deformable displacement. • We purpose a moving convected material reference frame approach to formulate the large deformation and large displacement approach.
Traditional Explicit Finite Element • X is the global position vector on time 0 of a particle within the continuum • when time = t, it’s global position is x-head • the deformation gradient is Fd
Traditional Co-rotational coordinate • If we set a co-rotation coordinate fixed on a particle and assume that the Fd has no rotational deformation, then dX and dX-head can be treated as the relative position by the co-rotational coordinate. • Let the particle doing the rigid body rotation R, then • If then
Lagrangian strain & Cauchy Stress • Lagrangian strain • The Cauchy stress from X to x