1 / 50

Thursday, October 11, 2012

Survey of Physics Engines for Games. Thursday, October 11, 2012. General information of Physics Engines - Description - Real-time vs. high-precision physics engines - Basis for a physics engine - Real-time physics engines Havok, Bullet, PhysX and ODE - Introduction

Download Presentation

Thursday, October 11, 2012

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.


Presentation Transcript

  1. Survey of Physics Engines for Games Thursday, October 11, 2012

  2. General information of Physics Engines - Description - Real-time vs. high-precision physics engines - Basis for a physics engine - Real-time physics engines Havok, Bullet, PhysX and ODE - Introduction - Comparison Contents

  3. General information of Physics Engines

  4. 1 No physics. 2 Gravity, no collision detection. 3 Gravity and collision detection, no rigid body dynamics. 4 Gravity, collision detection and rotation calculations. Physics Simulations by a physics engine These are four examples of a physics engine simulating an object falling onto a slope. The examples differ in accuracy of the simulation:

  5. A physics engine: - computer software - approximate simulation of certain physical systems - in the domains of  computer graphics,  video games and film - Mainly used in video games (simulations are in real-time) What is a physics engine? A physics engine in the context of a game application

  6. There are generally two classes of physics engines: real-time and high-precision. Real-time physics engines - video games & interactive computing - simplified calculations - decreased accuracy - compute in time High-precision physics engines - scientists and computer animated movies - more processing power - precise Real-time vs. high-precision

  7. Identifies and provides approximate simulation of certain simple physical systems. Rigid body dynamics Soft body dynamics Fluid Simulation Collision detection & response … Basis for a physics engine

  8. Rigid body dynamics is used heavily in analyses and computer simulations of physical systems and machinery where rotational motion is important, but material deformation does not have a significant effect on the motion of the system. The Rigid body dynamics basically must deal with: - Rigid body linear momentum - Rigid body angular momentum - Angular momentum and torque Rigid body dynamics

  9. Soft body dynamics focuses on visually realistic physical simulations. Generally, it only provide visually plausible emulations rather than accurate scientific/engineering simulations. This simulation can be done by using a variety of approaches: - Mass-spring models - Finite element simulation - Energy minimization methods - Shape matching - Rigid body based deformation Soft body dynamics

  10. Fluid simulation is increasingly popular. A fluid simulator uses the Navier-Stokes equations. Simulations range in complexity from extremely time-consuming high quality animations for film & visual effects, to simple real-time particle systems used in modern games. Some techniques for liquid simulation is as follows: - Eulerian grid-based methods - Smoothed particle hydrodynamics (SPH) methods - Vorticity-based methods - Lattice Boltzmann methods Fluid Simulation

  11. Collision detection typically refers to the computational problem of detecting the intersection of two or more objects.   Collision response deals with simulating what happens when a collision is detected. Solving collision detection problems requires extensive use of concepts from linear algebra and computational geometry: - Collision Detection for Flexible Surfaces - Collision Detection for Convex Polyhedra - Collision Response Using Springs - Collision Response Using an Analytical Solution - Collisions of Dynamic Objects with Non-Dynamic Objects Collision detection & response

  12. Real-time physics engines • Commercial Physics Engines (usually written in C++) • Most have license options that are attractively priced for indie and hobby developers

  13. Real-time physics engines

  14. Real-time physics engines • Open Source and Freeware Physics Engines

  15. Real-time physics engines • XNA-Compatible ports • Other ports • "Abstraction Layers"

  16. Havok, Bullet, PhysX and ODE

  17. Havok Physics is designed primarily for video games, and allows for real-time collision and dynamics of rigid bodies in three dimensions. Features: - Collision Detection - including Continuous Physics - MOPP Technology - for compact representation of large collision meshes - Dynamics and Constraint Solving - Vehicle Dynamics - Data Serialization and Art Tool Support - Visual Debugger for in-game diagnostic feedback Introduction-Havok

  18. Crash Nitro Kart、Half-Life 2、Max Payne 2、Medal of Honor、F.E.A.R.、Lord of the Rings: Middle Earth Online Projects

  19. PhysX is a proprietary real-time physics engine middleware SDK. PhysX SDK is only solution with fully-functional GPU/PPU physics acceleration pipeline. Features: - Massively Parallel Physics Architecture - High-speed GDDR3 Memory Interface - Universal Continuous Collision Detection - Physical Smart Particle Technology - Complex Object Physics System - Scalable Terrain Fidelity - Dynamic Gaming Framework Introduction-PhysX

  20. Game engines: Unity 3D, Gamebryo, Vision (version 6 onwards), Instinct Engine, Panda3D, Diesel, Torque, HeroEngine and BigWorld. Games: Bulletstorm, Need for Speed: Shift, Castlevania: Lords of Shadow, Mafia II, Alice: Madness Returns, Batman: Arkham City. Software: Active Worlds (AW), Autodesk 3ds Max, Autodesk Maya and Autodesk Softimage, DarkBASIC Professional (with DarkPHYSICS upgrade), DX Studio, Futuremark 3DMark Vantage, Microsoft Robotics Studio., Nvidia SuperSonic Sled and Raging Rapids Ride, technology demos, OGRE (via the NxOgre wrapper) Projects

  21. Bullet is an open source physics engine featuring 3D collision detection, soft body dynamics, and rigid body dynamics. It is used in games, and in visual effects in movies. Features: - Multi Platform support - Supports various shape types - Discrete Collision Detection for Rigid Body Simulation - Single Queries - Sweep and Prune Broad phase - Documentation and Support - Auto generation of MSVC project files, comes with Jam build system Introduction-Bullet

  22. - Bullet Collision Detection works with Bullet Dynamics, but there is also a sample integration with Open Dynamics Engine - Framework with 2 different Constraint Solvers - Hinge, Point to Point Constraint, Twist Cone Constraint (ragdolls) - Automatic de-activation (sleeping) - Generic 6 Degree of Freedom Constraint, Motors, Limits - LCP Warm starting of contact points - Collada 1.4 Physics Import using F Collada and COLLADA-DOM - Convex Decomposition Code Introduction-Bullet

  23. Movies: 2012, The A-Team, Hancock, Sherlock Holmes. Games: Toy Story 3, Grand Theft Auto IV, Red Dead Redemption, Trials HD by RedLynx, Free Realms, HotWheels, Madagascar Kartz, Regnum Online, 3D Mark 2011, Blood Drive, Hydro Thunder Hurricane. Tools: Blender, Cheetah3D. Projects

  24. The Open Dynamics Engine (ODE) is a physics engine in C/C++. Its two main components are a rigid body dynamics simulation engine and a collision detection engine. It was quite popular in 2005-2006. Currently ODE’s development seems to be suspended. ODE is a popular choice for robotics simulation applications, with scenarios such as mobile robot locomotion and simple grasping. Features: - Rigid bodies with arbitrary mass distribution. - Joint types: ball-and-socket, hinge, slider (prismatic), hinge-2, fixed, angular motor, linear motor, universal. - Collision primitives: sphere, box, cylinder, capsule, plane, ray, and triangular mesh, convex. - Collision spaces: Quad tree, hash space, and simple. - Simulation method: The equations of motion are derived from a Lagrange multiplier velocity based model due to Trinkle/Stewart and Anitescu/Potra. Introduction-ODE

  25. - A first order integrator is being used. It's fast, but not accurate enough for quantitative - engineering yet. Higher order integrators will come later. - Choice of time stepping methods: either the standard ``big matrix'' method or the newer iterative QuickStep method can be used. - Contact and friction model: This is based on the Dantzig LCP solver described by Baraff, although ODE implements a faster approximation to the Coulomb friction model. - Has a native C interface (even though ODE is mostly written in C++). - Has a C++ interface built on top of the C one. - Many unit tests, and more being written all the time. - Platform specific optimizations. Introduction-ODE

  26. BloodRayne 2, Call of Juarez, S.T.A.L.K.E.R, Titan Quest, World of Goo, X-Moto and Open Simulator Projects

  27. Most multi-purpose physics engines usually implement several methods: several different constraint solvers, friction models, collision detection method etc. ODE for example has both a pivoting/direct method and iterative methods such as blocked projected Gauss–Seidel (PGS). Bullet has similar iterative methods and is exploring nonsmooth nonlinear conjugate gradient methods as well. PhysX and Bullet has focused on using GPUs in their simulators. The algorithmic choices are still based on iterative methods in these works. Most game physics engines use a constraint solver based on iterative methods like the ones known from ODE and Bullet. The methods are confusingly named “sequential impulses” by the computer gaming community but the models are based on the constraint based paradigm and are solved using an iterative method such as PGS or similar. Comparison-Methods

  28. A collision detection module and an object joint module are very important for physics engines. The physics engine calculates the joint value of the inside object and the collision detection, and the changed position of the object and rotation value. Newton's equation of motion is applied in this case. Comparison-Methods

  29. The Euler method approximates y(x) ignoring more than the first differential coefficient in the process by Taylor series when differential equation and initial condition were given in the Eq. Comparison-Methods

  30. The improved Euler method approximates to the second differential coefficient. The following way shows the process of calculating to the second differential coefficient in Eq. Comparison-Methods )

  31. The Runge-Kutta method approximates to the fourth differential coefficient in the Taylor series. The following method shows the process that calculates to the fourth differential coefficient in Eq. Runge-Kutta methods achieve the accuracy of a Taylor series approach without requiring the calculation of higher derivatives. Comparison-Methods

  32. Physics Engines in 3D DCC Tools Comparison-Use

  33. To understand what is really needed and adopted by game industry 2006-2009 Comparison-Use

  34. PhysX SDK is preferred by small teams, is dominating PC market. Currently PhysX SDK is widely adopted by russian (mostly trash games) and korean (mostly specific MMOs) developers. Havok is currently best choice for AAA titles – extensive toolset, orientation on consoles, best-in-class developer support. In spite of the fact that ODE has some good games in its library, 54% of all titles are based on Chrome Engine from Techland – mainly that’s trash shooters from CITY Interactive or Russian UAZ 4×4 and it’s countless add-ons. Comparison-Use

  35. PhysX SDK is dominating on PC market. Standalone console versions of PhysX SDK existed even in 2005 (even certain games from PS3 and Wii start-up line were based on PhysX SDK), but still most of it’s console titles are based on UE3. Havok  is dominating on AAA and console market. Only Havok has advanced support for various platforms – not only PC and modern consoles, but Xbox, PS2 and even PSP. ODE was used in several games for Wii, but majority of titles are still Chrome engine based games for PC. Bullet is used in several of today’s hyperrealistic video games and feature film visual effects. Comparison-Use

  36. Criteria: There are six essential factors that determine the overall performance of the physics engine: - Simulator Paradigm, determines which aspects can be accurately simulated. This affects the accuracy in resolving constraints. - The integrator, determines the numerical accuracy of the simulation. - Object representation, contributes to the efficiency and accuracy of collisions in the simulation. - Collision detection and contact determination, also contribute to the efficiency and accuracy of collisions in the simulation. - Material properties, determines which physical models, if any, the simulation can approximate (eg: Coloumb friction). - Constraint implementation, determines which constraints are supported and how accurately they can be simulated. Comparison-Performance

  37. Physics Engines common features & Grading

  38. Testing the physics engines with some physical fact in the real world, might give a hint on how correct the engine is. This test has a simple configuration of a pendulum and a free-fall then each engine’s simulation will be compared to the “correct” physical behavior. Basic accuracy

  39. Basic accuracy

  40. Constraint stability is one of the areas of importance for game designers. If constraints are unstable numerical errors can cause constrained bodies to slowly drift apart. This results in unrealistic looking results. This is also of critical importance for simulation engineers simulating multi-body robotic systems, the traditional application of dynamic simulation systems. Constraint Stability

  41. Constraint Stability Constraint error Constraint error Average time per constraint Constraint timing

  42. Objects that collide and bounce of each other is a common scenario. This test looks at how the different physic engines handle this. Bounce

  43. Bounce Bounce results with different values of restitution Maximum bounce height for varying values of restitution

  44. A common way to demonstrate a physics toolkit is to have a scene with a big pile of boxes which is then destroyed. This scene is not always that common in real applications. Despite this, piling seems to be a way of measuring how good a physics toolkit is, the following test will look into how the different toolkits scale when boxes are piled on top of each other. Scalability of contacts

  45. Scalability of contacts Computational Effort of Stacked objects Time to solve contacts

  46. General Information: Physics Engine for Simulation. By R. Gaurav Agarwal. From Sources

  47. Features of different physics engines and their applications : Havok:, Bullet: Novodex: ODE: Comparison: Sources

  48. Videos: ODE: Havok: Numerical Integration Methods: Performance Evaluation of Numerical Integration Methods in the Physics Engine. By Jong-Hwa Choi, Dongkyoo Shin, Won Heo and Dongil Shin. From Interactive Simulation of Rigid Body Dynamics in Computer Graphics. By Jan Bender, Kenny Erleben, Jeff Trinkle and Erwin Coumans. From Sources

  49. Comparison: PhysX vs. Havok: Bullet vs. Novodex vs. ODE: Evaluation of real-time physics simulation systems. By Adrian Boeing, Thomas Bräunl. From Havok vs. Bullet vs. Novodex vs. ODE: COLLADA physics. By Erwin Coumans, Keith Victor. From Novodex vs. ODE: Evaluation of Physics Engines and Implementation of a Physics Module in a 3d-Authoring Tool. By SEUGLING, A, and ROLIN M. From Evaluating Physics Engines For Games – PAL: ODE vs. Bullet: Sources

  50. Thank you

More Related