1 Game Physics. 2 Introduction to Game Physics Traditional Game Physics Traditional Game Physics –Particle system –Rigid body dynamics –Flexible body.

Slides:



Advertisements
Similar presentations
Real-Time Game Physics
Advertisements

1 Game Physics. Traditional game physics Traditional game physics –Particle system –Rigid body dynamics –Flexible body dynamics Some state-of-art topics.
R2-1 Physics I Review 2 Review Notes Exam 2. R2-2 Work.
Chapter 8 Rotational Equilibrium and Rotational Dynamics.
1Notes  Textbook: matchmove 6.7.2, B.9. 2 Match Move  For combining CG effects with real footage, need to match synthetic camera to real camera: “matchmove”
Particle Systems 1 Adapted from: E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012.
Test 3 today, at 7 pm and 8:15 pm, in Heldenfels 109 Chapters
Ch. 7: Dynamics.
1 7M836 Animation & Rendering Animation Jakob Beetz Joran Jessurun
1cs426-winter-2008 Notes  If you’re interested, read Bridson, Hourihan, Nordenstam, “Curl noise for procedural fluid flow”, SIGGRAPH ‘07.
Game Physics Chris Miles. The Goal To learn how to create game objects with realistic physics models To learn how to simulate aspects of reality in order.
Physics 101: Lecture 18, Pg 1 Physics 101: Lecture 18 Rotational Dynamics l Today’s lecture will cover Textbook Sections : è Quick review of last.
Final exam: room 105 HECC, 8-10 am, Wednesday, December 12 th.
Chapter 8 Rotational Equilibrium and Rotational Dynamics.
1cs426-winter-2008 Notes. 2 Velocity fields  Velocity field could be a combination of pre-designed velocity elements E.g. explosions, vortices, …  Or.
Computer-Based Animation. ● To animate something – to bring it to life ● Animation covers all changes that have visual effects – Positon (motion dynamic)
Computer graphics & visualization Rigid Body Simulation.
Feature-length films: Games: Desktop Animations: Computer Animation.
Computer Animation Rick Parent Computer Animation Algorithms and Techniques Physically Based Animation.
1 Game Physics. 2 Introduction to Game Physics Traditional game physics Traditional game physics Particle system Particle system Rigid body dynamics Rigid.
Physically Based Animation and Modeling
Spring Topic Outline for Physics 1 Spring 2011.
Modelling and Simulation Dynamics. Dynamics Dynamics is a branch of physics that describes how objects move. Dynamic animation uses rules of physics to.
Game Physics – Part I Dan Fleck Coming up: Rigid Body Dynamics.
© Fox, McDonald & Pritchard Introduction to Fluid Mechanics Chapter 5 Introduction to Differential Analysis of Fluid Motion.
Copyright Kaplan AEC Education, 2005 Dynamics Outline Overview DYNAMICS, p. 193 KINEMATICS OF A PARTICLE, p. 194 Relating Distance, Velocity and the Tangential.
CS559: Computer Graphics Lecture 38: Animation Li Zhang Spring 2008 Slides from Brian Curless at U of Washington.
Spring Rigid Body Simulation. Spring Contents Unconstrained Collision Contact Resting Contact.
8.4. Newton’s Second Law for Rotational Motion
Chapter 9: Rotational Dynamics
12/01/2014PHY 711 Fall Lecture 391 PHY 711 Classical Mechanics and Mathematical Methods 10-10:50 AM MWF Olin 103 Plan for Lecture 39 1.Brief introduction.
NVIDIA PhysX: 物理引擎 (Physics Engine) V-lab Talk 2010/12/03 洪偉瀚.
Fundamentals of Computer Animation Natural Phenomena: Water Surfaces.
Advanced Computer Graphics Rigid Body Simulation Spring 2002 Professor Brogan.
Particles Paul Taylor Polygons are not so hot! Good for representing objects like A Cup A Robot A Pyramid Not so hot for creating Hair Snowflakes.
1 Honors Physics 1 Summary and Review - Fall 2013 Quantitative and experimental tools Mathematical tools Newton’s Laws and Applications –Linear motion.
Spring Rigid Body Simulation. Spring Contents Unconstrained Collision Contact Resting Contact.
© Fox, Pritchard, & McDonald Introduction to Fluid Mechanics Chapter 5 Introduction to Differential Analysis of Fluid Motion.
Discontinuous Displacement Mapping for Volume Graphics, Volume Graphics 2006, July 30, Boston, MA Discontinuous Displacement Mapping for Volume Graphics.
Robotics II Copyright Martin P. Aalund, Ph.D.
1 Rotation of a Rigid Body Readings: Chapter How can we characterize the acceleration during rotation? - translational acceleration and - angular.
Rigid Body Dynamics CSE169: Computer Animation
今日課程內容 CH10 轉動 角位移、角速度、角加速度 等角加速度運動 轉動與移動關係 轉動動能 轉動慣量 力矩 轉動牛頓第二運動定律.
Particles and their home in Geometry Shaders Paul Taylor 2010.
Advanced Games Development Game Physics CO2301 Games Development 1 Week 19.
Rick Parent - CIS682 Rigid Body Dynamics simulate basic physics of an object subject to forces Keyframing can be tedious - especially to get ‘realism’
Graphics for Games Particle Systems CO2301 Games Development 1 Week 23.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Dynamics. Motion with Regard to Mass Particle Dynamics Mass concentrated in point Newton’s Equation Governs Motion f = M x.
Physics 111 Lecture Summaries (Serway 8 th Edition): Lecture 1Chapter 1&3Measurement & Vectors Lecture 2 Chapter 2Motion in 1 Dimension (Kinematics) Lecture.
 The metric system – units, prefixes  Unit conversions  Algebra and trigonometry  Orders of magnitude.
Feature-length films: Games: Desktop Animations:.
UNIT 6 Rotational Motion & Angular Momentum Rotational Dynamics, Inertia and Newton’s 2 nd Law for Rotation.
CS559: Computer Graphics Lecture 26: Animation Li Zhang Spring 2010 Slides from Brian Curless at U of Washington.
Dynamics of a System of Particles Prof. Claude A Pruneau Notes compiled by L. Tarini Physics and Astronomy Department Wayne State University PHY 6200 Theoretical.
1 Geometry for Game. Geometry Geometry –Position / vertex normals / vertex colors / texture coordinates Topology Topology –Primitive »Lines / triangles.
Advanced Computer Graphics Rigid Body Simulation
Physically Based Simulations For Games
Games Development Practices 3D Modelling
Lecture Rigid Body Dynamics.
Lecture 16 Newton Mechanics Inertial properties,Generalized Coordinates Ruzena Bajcsy EE
Translational-Rotational Analogues
Manipulator Dynamics 2 Instructor: Jacob Rosen
Advanced Computer Graphics Spring 2008
Rigid Body Dynamics (unconstrained)
Physically Based Animation and Modeling
Advanced Games Development Game Physics
Introduction to Fluid Mechanics
GPAT – Chapter 7 Physics.
Presentation transcript:

1 Game Physics

2 Introduction to Game Physics Traditional Game Physics Traditional Game Physics –Particle system –Rigid body dynamics –Flexible body dynamics Some State-of-art Topics Some State-of-art Topics –Car physics –Fluid dynamics –Rag-doll physics Physics Physics –Rigid body kinematics –Newton’s Laws –Forces –Momenta –Energy

3 Basic Concepts from Physics (1/2) Newton’s Laws Newton’s Laws –1 st Law »“ 靜者恆靜,動者恆成等速度運動 ” –2 nd Law »F = ma = m  v/  t –3 rd Law » 作用力與反作用力 Forces Forces –Gravity / Spring forces / Friction / Viscosity –Torque »  = r X F –Equilibrium

4 Basic Concepts from Physics (2/2) Momenta Momenta –Linear momentum –Angular momentum –Moment of inertia

5 Particles are objects with Particles are objects with –Mass –Position –Velocity –Respond to forces But no spatial extent (no size!) But no spatial extent (no size!) –Point mass Based on Newton Laws Based on Newton Laws –f = ma –x = f / m –v = f / m, x = v Particle Dynamics....

6 typedef struct { float m; /* mass */ float *x; /* position */ float *v; /* velocity */ float *f; /* force accumulator */ } *Particle; typedef struct { Particle *p /* array of pointers to particles */ int n; /* number of particles */ float t; /* simulation clock */ } *ParticleSystem; xvfmxvfm states xvfmxvfm xvfmxvfm xvfmxvfm xvfmxvfm xvfmxvfm … Particle n time Basic Particle System

7 /* gather states from the particles */ void ParticleGetState(ParticleSystem p, float *dst) { int i; for (i = 0; i n; i++) { *(dst++) = p->p[I]->x[0]; *(dst++) = p->p[I]->x[1]; *(dst++) = p->p[I]->x[2]; *(dst++) = p->p[I]->v[0]; *(dst++) = p->p[I]->v[1]; *(dst++) = p->p[I]->v[2]; } }

8 /* scatter states into the particles */ void ParticleSetState(ParticleSystem p, float *src) { int i; for (i = 0; i n; i++) { p->p[i]->x[0] = *(src++); p->p[i]->x[1] = *(src++); p->p[i]->x[2] = *(src++); p->p[i]->v[0] = *(src++); p->p[i]->v[1] = *(src++); p->p[i]->v[2] = *(src++); } }

9 /* calculate derivative, place in dst */ void ParticleDerivative(ParticleSystem p, float *dst) { int i; ClearForce(p); ComputeForce(p); for (i = 0; i n; i++) { *(dst++) = p->p[i]->v[0]; *(dst++) = p->p[i]->v[1]; *(dst++) = p->p[i]->v[2]; *(dst++) = p->p[i]->f[0]/p->p[i]->m; *(dst++) = p->p[i]->f[1]/p->p[i]->m; *(dst++) = p->p[i]->f[2]/p->p[i]->m; } }

10 /* Euler Solver */ void EulerStep(ParticleSystem p, float DeltaT) { ParticleDeriv(p, temp1); ScaleVector(temp1, DeltaT); ParticleGetState(p, temp2); AddVector(temp1, temp2, temp2); ParticleSetState(p, temp2); p->t += DeltaT; }

11 Rigid Body Dynamics Mass of a Body Mass of a Body –Mass center Force Force –Linear momentum –P(t) = M v(t) –Velocity (v) Torque Torque –Angular momentum –L(t) = I  (t) –Local rotation (  ) Inertia Tensor Inertia Tensor Reference Reference –www-2.cs.cmu.edu/afs/cs/user/baraff/www/pbm

12 Flexible Body Dynamics (1/2) Particle-Spring Model Particle-Spring Model –F = k x –Not a stress-strain model –Lack of Elasticity, Plasticity, & Viscous-Elasticity –Can be unstable

13 Flexible Body Dynamics (2/2) Finite Element Method Finite Element Method –Solver for ODE/PDE –Boundary conditions –Energy equation –Stress-strain model –Very complicated computing process Conservation of Energy Conservation of Energy

14 Advanced Topics in Game Physics Fracture Mechanics ( 破壞力學模擬 ) Fracture Mechanics ( 破壞力學模擬 ) Fluid Dynamics ( 流體力學 ) Fluid Dynamics ( 流體力學 ) Car Dynamics ( 車輛動力學 ) Car Dynamics ( 車輛動力學 ) Rag-doll Physics ( 人體物理模擬 ) Rag-doll Physics ( 人體物理模擬 )

15 Game FX

16 Introduction to Game FX Improve the Visual & Sound Game Effects Improve the Visual & Sound Game Effects Includes Includes –Combat FX –Environment FX –Character FX –Scene FX –Sound FX FX Editor Needed FX Editor Needed –General 3D animation can not do it »Key-frame system is nor working »FX animation is always Procedurally Procedurally Related to the previous frame Related to the previous frame Small Work But Large Effect Small Work But Large Effect

17 FX Editing Tool

18 Combat FX During the Combat During the Combat –Weapon motion blur –Weapon effect –Skill effect After the Combat After the Combat –Damage effect FX Editor FX Editor

19 Combat FX Example

20 Motion Blur – Image Solution Computer Animation : Computer Animation : –Image solution –Blending rendered image sequence »Render too many frames »Divide the frames »Average »Done!

21 Motion Blur – Geometry Solution In Games, Use Transparent Objects to Simulate the Motion Blur In Games, Use Transparent Objects to Simulate the Motion Blur “False” Motion Blur “False” Motion Blur –Tracking the motion path of the object –Connecting them as a triangular mesh –Use time-dependent semi-transparency to simulate the “blur” –The path can be smoothed using Catmull-Rom spline »Local stability of the curve

22 FX Uses Texture Animation Almost All Game FXs Use this Trick Almost All Game FXs Use this Trick Geometry Object on which the Texture Animation Playing Geometry Object on which the Texture Animation Playing –Billboard –3D Plate –Cylinder –Sphere –Revolving a cross section curve Texture Sequence with Color-key Texture Sequence with Color-key Semi-transparent Textures Semi-transparent Textures –Alpha blending »Source color added to background Demo!!!! Demo!!!!

23 Particle System for FXs in Combat The FXs The FXs –Fire / exposure / smoke / dust Initial Value + Time dependency Initial Value + Time dependency Combined with Billboard FX Combined with Billboard FX –Billboard to play the texture animation –Particle system to calculate the motion path Gravity is the major force used Gravity is the major force used Emitter pattern Emitter pattern –Single emitter –Area emitter –Emitter on vertices Demo !!! Demo !!!

24 Environment FX Weather Weather –Use particle system »Rain »Snow »Wind Fog Fog –Traditional fog »From near to far »Hardware standard feature –Volume fog »Layered fog »Use vertex shader Day & Night Day & Night

25 Character FX Fatality Fatality –Case by case and need creative solutions Rendering Effects on Skins Rendering Effects on Skins –Environment mapping –Bump map –Normal map –Multiple texture map Flexible body Flexible body –Flexible body dynamics Fur Fur –Real-time fur rendering …

26 Scene FX – Sky Box Use a very large box or dome-like model to surround the whole game scene Use a very large box or dome-like model to surround the whole game scene Use textures on the box or dome as the backdrop Use textures on the box or dome as the backdrop Use multiple textures and texture coordinates animation to simulate the moving of the clouds Use multiple textures and texture coordinates animation to simulate the moving of the clouds

27 Scene FX – Len’s Flare Runtime calculate the position and orientation of the camera with the sun Runtime calculate the position and orientation of the camera with the sun Put textures to simulate the len’s flare Put textures to simulate the len’s flare

28 Scene FX – Light Scattering Atmospheric Light Scattering Atmospheric Light Scattering Caused by dust, molecules, or water vapor Caused by dust, molecules, or water vapor –These can cause light to be: »Scattered into the line of sight (in-scattering) »Scattered out of the line of sight (out-scattering) »Absorbed altogether (absorption) Skylight and sun light Skylight and sun light Can be Implemented by Vertex Shader Can be Implemented by Vertex Shader

29 Scene FX – Light Scattering Examples With scatteringWithout scattering