Lab 3 Particle Systems
Total Page:16
File Type:pdf, Size:1020Kb
1/14/2013 Course Materials . Course webpage: 01 - Introduction . http://www.scss.tcd.ie/John.Dingliana/cs7057 CS7057 – Real-time Physics • Lecture Slides • Labs • Readings from the course . Submission and feedback will be handled through Blackboard system . http://mymodule.tcd.ie Background images taken from layoutsparks.com and used without permission. http://images2.layoutsparks.com/1/162592/abstract-bright-dark-flashing.jpg (17/09/2012) Relevant References Learning Outcomes . Baraff, Witkin and Kass “Physically based Animation Course Notes” – . On Completion of this course, Students should be able to: Siggraph 2001 Most of the Labs are based on these notes . http://www.pixar.com/companyinfo/research/pbm2001/ . Outline and describe the architecture and components of a physics- based motion pipeline that would be employed in a typical game. Mueller, James, Theurey, Stam “Real-time Physics” – Siggraph 2008 . http://www.matthiasmueller.info/realtimephysics/index.html . Explain basic rigid body dynamics and the mechanics of deformable systems. Ian Millington – “Game Physics Engine Development” . Analyze and compare different approaches for collision detection and collision response of rigid and deformable objects. Kenny Erleben - “Physics based animation” . Build a real-time rigid body simulation system for convex polyhedra. David H.Eberley“Game Physics Engine Development” Assessment Physically Based Modelling Cs7057 Final . 100% based on coursework Mark [100%] . A form of Procedural Modelling . ~55% Labs . Synthesize motions of inanimate . ~40% Final Assignment Labs Final Project Readings [~5%] objects due to external forces [~60%] [~40%] . ~5% Prescribed Reading . Motivations: . Lab assessment: Cumulative . Realism / plausibility Weekly Mark . Weekly demos ~80% Submission [~80% of labs] . Final Cumulative submission ~20% [~20% of labs] . Automation Youtube Video . Interaction Approx. 4 page written report Source code . Details of Final Project and Readings will be provided later in the term . IMPORTANT NOTE: All work is expected to be done individually, . where other help or sources are used these should be duly referenced. Students are expected to familiarise themselves with and abide by college’s regulations on plagiarism Jenga App © 2010, NaturalMotion Image From: http://appadvice.com/appnn/2010/12/review-jenga/ 1 1/14/2013 Application Areas State of the Art (commercial) . LucasArts’ Star Wars – The Force Unleashed [2008] featured 3 different state-of-the art technologies in Physics in industry . Havok Physics : for gameplay rigid body dynamics physics . NaturalMotion Euphoria for physically responsive non-player character behaviour . Pixelux DMM for deformable and destructable effects physics Tech Trailer: http://www.gametrailers.com/video/unleashing-the-star-wars/29964 Digital Molecular Matter (DMM) Some Physics Engines http://www.pixelux.com/DMMengine.html State of the Art (Research) Incompressible Solids [Irving et al 2007] There is a vast amount of research literature in Physically Based Animation that deals with highly complex effects that is not yet fully exploited in commercial applications Deformable Objects © Ron Fedkiw Fluid Animaton © Cem Yuksel Character Physics ©Michael Neff physbam.stanford.edu/~fedkiw/papers/stanford2007-01.pdf 2 1/14/2013 Types of Animation Procedural Animation Animation is encoded in a set of rules. Mathematical models are employed to define motions i.e. Anything not explicitly Discussed in Procedural physically Real-time Animation based e.g. Animation or splines Autonomous Agents Physically- Ad-hoc Behavioural based Procedural Animation Animation Animation Particle Deformable Rigid Bodies Fluids Systems Objects Predator animation is © Adriano Rinaldi [http://web.tiscali.it/maya_tutorial/] Physically Based Animation Dynamic Simulation Kinematics: describes motion without considering forces that cause it . Rules of physics used to calculate Forward Inverse motion Kinematics: Kinematics: given . Take into account... given positions, orientations, find find orientations positions . Forces Friction Gravity Inverse Forward Buoyancy Dynamics: given Dynamics: given the start and end the start Elasticity points (i.e. the conditions and motion), what forces, calculate . Collisions / spatial occupancy are the forces the motion Most relevant for interactive apps Dynamics: describe motion taking into account mass and forces Motivations Game Physics . Why use Physically based models? . Relatively small number of basic concepts are re-used for most game physics: . Inherits advantages from procedural modelling . Newton’s laws of motion . Non-linear experiences: unlimited possibilities from relatively small amount of manual content creation . Stress and Strain: deformable models . Non-deterministic . Navier Stokes equation: fluids . Extends with real-world physical constraints . Major challenge is in finding numerical solutions that are sufficiently complex and sufficiently generalizable . Relatively well defined (even mathematically) Discrete representations exist – can encode this in programs Finite set of rules and parameters . Plausible (hopefully) 3 1/14/2013 Classes of Game Physics Effects Physics Effects Physics Gameplay Physics • Live Secondary Animations • Fully interactive • One-way Interaction • Affects the user • e.g. Particle effects, cloth Pre-computed Physics Off-line Physics • Canned Physics • e.g. Cinematics / • Secondary Animations e.g. cutscenes Cloth, water, some • Pre-calculated character animations Game • Pre-rendered Physics Havok FX Demo © 2005 Havok Gameplay Physics In-game Physics Efficiency: Plausibility: • on-the-fly real-time • not necessarily computation accurate or real, but convincing Fidelity: Robustness: • model reasonably • run unsupervised complex phenomena over many frames to make it without exploding worthwhile Basic Animation Loop Basic Physics Loop 4 1/14/2013 Basic Physics Loop (2) Physics State Variables and Constants Apply forces and m v update state of Position Mass object based on Velocity Acceleration / Forces p forces F Orientation Moments of Inertia Spatial Centre of Mass Occupancy Angular Velocity Torque M v Plasticity Elasticity p Density Viscosity F Opacity Texture Apply collision Check if objects forces/impulses are intersecting Friction ... Collision Detection Collision Detection Sphere-sphere Sphere-plane Polygon-polygon Triangle-Triangle A diverse problem (lots of special cases) but not extremely difficult to solve Collision Detection and Intersection testing e.g. Lots of Intersection Source Code Available Here: http://www.geometrictools.com/LibFoundation/Intersection/Intersection.html check if an object intersects another – a common operation in computer graphics Problem: Complexity Collision Proxies Halflife, 1998 Counterstrike (Mod), 1999 ... sometimes they do (right) Current graphical data sets are generally more detailed Possible solution: Use simplified e.g. Hit boxes commonly used in games than we wish to deal with for collision detection. representation. (Even this is generally approximate the actual mesh. overkill for game physics) 5 1/14/2013 Collision Proxies Dynamics Havok Example: Proxies • All physics objects are approximations of display meshes. • Finer Rag-doll collision proxy for character used in effects physics interactions with objects in scene. • A much coarser bounding ellipsoid proxy used for navigation (yellow blob below) Images © Havok 2007 Two Phase Collision Detection Bounding Volumes Use a coarse over approximation of the object i.e. A bounding volume (conservative overestimate) that is geometrically much simpler than the object. Only do more detailed Quite often no amount of simplification is enough – scenes require more and more intersection tests if bounding volume intersects. objects, users more demanding of accuracy. Solution: cull some trivial cases (how we do this will be discussed in more detail later in the module) Narrow phase •Per-object : coarse culling of non-colliding cases •Pair-wise between objects •Per-feature •Narrow-in on collision – calculate finer features e.g. collision manifold, penetration depth Broad phase Image used without permission from Real-time Collision Detection – by Christer Ericson Bounding Volume Hierarchies Collision Response . Hierarchical, multi-resolution representations of objects. Once objects are found to be colliding collision process applies forces/impulses . Enables Progressive Culling: to stop them intersecting to create plausible physically based reactions. Starting at root, only check children if this collides . Repeat until we get to finest level then do triangle checks . Key Concerns in Interactive Physics: . Robustness: response must assure system remains stable in all possible states . Plausibility: response to collision must be believable . Efficiency: physics processing must be fast enough to enable real-time frame rates Levels of an AABB Resting Impulses Constraints Friction Tree Hierarchy contact 6 1/14/2013 Deformable Objects Fluids Cloth Soft Bodies Hair Fracture Images © Ron Fedkiw (http://physbam.stanford.edu/~fedkiw/) Images © Ron Fedkiw (http://physbam.stanford.edu/~fedkiw/) Tentative Lecture Plan Planned Assessment MONDAY THURSDAY . Weekly Labs 1 INTRODUCTION PARTICLE SYSTEMS RIGID-BODIES 1. Particle Systems ~9% 2 LAB: RIGID BODIES COLLISION DETECTION 2. Rigid-body Animation: ~9% 3 LAB: BROAD PHASE COLLISION DETECTION COLLISION DETECTION 2 3. Broad-phase Collision Detection: ~9% 4 LAB: NARROW PHASE COLLISION DETECTION COLLISION RESPONSE 4. Narrow-phase Collision Detection: ~9% 5 LAB: COLLISION RESPONSE BOUNDING VOLUME HIERARCHIES 5. Collision Response: ~9% 6 LAB (COLLISION RESPONSE MARKING) PHYSICS ENGINES . Cumulative Lab Submission ~10% READING WEEK [27 FEB – 02 MAR] . Rigid body engine & particle system 8 LAB: FINAL PROJECT PROPOSALS MULTI-COLLISIONS • Youtube Video 9 DEFORMABLE OBJECTS CLOTH SOFT BODIES • Report 10 ST. PATRICK’S DAY BANK HOLIDAY [18 MAR] LAB: INTERMEDIATE PROGRESS • Source code (for the record: not marked based on this) 11 FLUIDS DESTRUCTION/FRACTURE CHARACTER PHYSICS . Final Project: ~40% 12 EASTER MONDAY [1 APR] FINAL ASSIGNMENT PRESENTATIONS . Readings: ~5% 7 .