Transcript Document
New simulation algorithm and architecture for Game Physics Michael Lin President & CEO Reality Matrix Inc. [email protected] 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 rigidbody 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 rigidbody 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 SMALLDEFORMATION. 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 quasistatic 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 corotational 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 xhead • 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 • If we define the Cauchy stress is sigma-head from X to x-head, then sigma-head is also the Cauchy stress within the co-rotational coordinate. • We can compare the two equations listed above, • So the Piola stress function S and the strain function E, does not change with the rotation. • To simplify the fem analysis and make the shape function to satisfy the boundary condition of continuity, we set another co-rotation frame. • So we change the position vector X , x and x prime to transform as X-head, Q is the transformation matrix • Although the constitutive equation has to satisfy the principle of objectivity, or the principle of material frame indifference, [Malvern]. • According to this principle , the form of S has to satisfy • So S and S-head comes from the same type. This conclusion is the same with traditional co-rotational coordinate. Some conclusion • In our approach, the co-rotational coordinate definition seems different form traditional. We not limited to small deformation and principle of superposition. • The transformation matrix and rotational matrix can be different, so the co-rotational coordinate can be set in another way. • But the definition of strain, E-prime, or the constitutive equation S, and the form of calculation about the virtual internal work is the same with traditional co-rotational method. • the Piola stress seems the same in our approach by global coordinate and corotational coordinate, the Cauchy stress is not the same. • If the rotational matrix and transformation matrix comes the same, then What’s going wrong? • When large deformation come with large rotation, the deformation and rigid body motion can not be defined separately. • When particle mass was moving by external force, the transformation matrix is including deformation and rotation: the superposition is no longer exist! • we use the vector form finite element method to handling the large displacement and large deformation. • the Piola stress seems the same in our approach by global coordinate and co-rotational coordinate, the Cauchy stress is not the same. • When the current form of object is obviously different from the initial form, some mathematics condition may not be satisfied. • For example the deformation gradient, we often assume it as the positive definite, when the large strain comes, Jacobian may be positive. • So in planning the computing process, it seems to be suitable by using the incremental of deformation. Nonlinear Material Modeling • To handle the large deformation material properties, in the past we usually use the total-stress-strain relationship. For example for the rubber elasticity proposed: neo-Kookea material and Moony-Rivlin material, Green and Adkins, Murnaghan and so on. • We thought that they are because the traditional mechanics of large deformation approach to formulate the simple geometry model, to make a assumption to be corresponding the equilibrium equations and analytic solutions. Some benefits • Fist, if we reduce the increment of force, the total stress-strain relationship, according to the differential and mean-value theory, we can express them using the linear incremental relationship. We compare the total stress model and plastic flow theory about the elastic-plastic materials; we might see the advantage of the incremental model. • Second, when an object is going through the large deformation, it can not maintain the homogenous deformation state. That means, the history of large deformation is no longer a proportional loading process. It should be use the incremental form of constitutive equation.So using the incremental constitutive law is reasonable and simple. Incremental stress and strain • The incremental stress, incremental strain and the virtual work can be expressed as follows: • Where, Incremental Constitutive Law • If large deformation process can be expressed by incremental stress and incremental displacement as a basis, then the material model can be expressed be incremental method. • When an object is going through the large deformation, it can not maintain the homogenous deformation state. • That means, the history of large deformation is no longer a proportional loading process. It should be use the incremental form of constitutive equation. Some considerations about the fracture algorithm • If the material model is non continuous, something like traditional elastic-plastic material model or viscous elastic material type, it should be added in the iteration process in formulating the equation sets. • After the object is cracked, the geometry form of the body will have great changes. For a small individual, it will face to large displacement and rigid body motion on it. • Our approach mainly focus on a new vector form algorithm about continuum and naturally support fracture simulation, nonlinear material models, large deformation and the core support the parallel and distributed computing from mathematically to code architecture. The real-time fragmentation method • The judgment of nodal failure criterion • The failure process • This is a general algorithm can be adapted to any kind of mesh types. • Basically, we just use the maximum principle stress direction to judge the direction about the failure. When the internal tensile strength in exceed the material tensile strength, of course, that’s why the object will be break. No d a l C o o rd in a te Dire ctio n i Z 48 8 4 3 1 i i Y41 i X 43 i P Ma x P rin cip le S tre ss Dire ctio n i unit vector X axis opening P i Y41 i P i Z 48 i P i X 43 2 > 0. 9 Y axis opening Z axis opening Criterion of Nodal Failure Modes • First, we should set up the unit vector for each element and nodes. In co-rotational coordinate, this unit vector will rotate by time and geometry changes. So it should be updated on each time step will be the correct boundary position of the element. • When the system is receiving the permit about the failure along the element boundary, we start the failure procedures. In element-based method, we are happy to use the nodal connect table because it is simple. Fragmentation (4) (3) i (1) i i (2) P P iY P 1 (8) (7) 4 3 3 (6) i Y48,(4) iY iY 1 i Y 84,(5) i Y 48,(7) P i Y 84,(1) i Y 84,(2) i Y 84,(6) iY i P 48,(3) 1 2 3 4 4 3 2 Fragment Line 1 1 2 48,(8) i iY 3 4 2 2 (5) iY 4 Fra gm e n t Su rfa ce > 0 , Group [1] < 0 , Group [2] iY iY Issues about the synchronization • In parallel computing for large computational project, the synchronization is a very important issue. • Too much or under considerations will cause the system performance down or loss control of each CPU. That will cause the whole system crash and give us the wrong answer. • That’s we should notice about parallel and nonparallel part in the algorithm and codes. Generalization • Our approach has introduced a general description of particle motion. The handling of finite element rigid body motion with deformation is different from the classical continuum mechanics. Progress • We may assume that mass points are inside the element, and the total number varies according to the stress or deformation intensity. Their positions may also be adjusted, and thus give a more accurate stress distribution. • To satisfy continuity requirements of a continuum, we choose to use the standard element shape functions to calculate internal forces acting on the mass particle. Our approach is not limited to that. For specific physical problems, we may choose to use a mixture of different models for the calculation. They include finite difference procedures with differential equations, formulas deduced from test data and mathematical analyses. • Since our approach assumes that the body is a collection of particles, different models can be calculated independently and then assembled for each particle. Outlook • Failure analysis – • Program based on our approach can be developed to provide quantitative predictions of the initiation of failure, subsequent failure sequence and a total collapse or disintegration of the structure. Penetration mechanics – Our approach is able to model moving projectiles, multiple continuous media, and fragmentation. Thus, it is possible to study the time history of entire penetration process as a function of projectile geometry, traveling speed, impact angle and material properties. • Impact and collision – Explicit finite elements have been effectively implemented to conduct safety analyses of reactor structures, to evaluate crash-worthiness of trucks and automobiles, and to model explosion and demolition. • Thank you ~ • We’re happy to cooperate with anyone who loves game physics and interest about more advanced algorithm. • Reality Matrix Inc. • Zigma Technology. • [email protected] • I am welcome for your email~