PHYSICALLY BASED ANIMATION

Similar documents
2.7 Cloth Animation. Jacobs University Visualization and Computer Graphics Lab : Advanced Graphics - Chapter 2 123

Mass-Spring Systems. Last Time?

Navier-Stokes & Flow Simulation

The Jello Cube Assignment 1, CSCI 520. Jernej Barbic, USC

CGT 581 G Fluids. Overview. Some terms. Some terms

Realtime Water Simulation on GPU. Nuttapong Chentanez NVIDIA Research

Animation of Fluids. Animating Fluid is Hard

The jello cube. Undeformed cube. Deformed cube

Overview of Traditional Surface Tracking Methods

Shape of Things to Come: Next-Gen Physics Deep Dive

CS-184: Computer Graphics Lecture #21: Fluid Simulation II

Physically Based Simulation

Navier-Stokes & Flow Simulation

Smoke Simulation using Smoothed Particle Hydrodynamics (SPH) Shruti Jain MSc Computer Animation and Visual Eects Bournemouth University

Physically Based Simulation

Realistic Animation of Fluids

Cloth Simulation. Tanja Munz. Master of Science Computer Animation and Visual Effects. CGI Techniques Report

Dynamical Simulation 1: Particle Systems and ODEs

Fluid Simulation. [Thürey 10] [Pfaff 10] [Chentanez 11]

Simulation in Computer Graphics. Particles. Matthias Teschner. Computer Science Department University of Freiburg

Simulation in Computer Graphics. Deformable Objects. Matthias Teschner. Computer Science Department University of Freiburg

Modeling Cloth Using Mass Spring Systems

Cloth Hair. and. soft bodies

Realistic Animation of Fluids

Cloth Simulation. COMP 768 Presentation Zhen Wei

Module 4: Fluid Dynamics Lecture 9: Lagrangian and Eulerian approaches; Euler's acceleration formula. Fluid Dynamics: description of fluid-motion

A High Quality, Eulerian 3D Fluid Solver in C++ A Senior Project. presented to. the Faculty of the Computer Science Department of

Physically based modelling Computer Graphics I February 27, 2003

CS205b/CME306. Lecture 9

FLUID SIMULATION. Kristofer Schlachter

Solution for Euler Equations Lagrangian and Eulerian Descriptions

Navier-Stokes & Flow Simulation

Simulation in Computer Graphics. Introduction. Matthias Teschner. Computer Science Department University of Freiburg

Particle-Based Fluid Simulation. CSE169: Computer Animation Steve Rotenberg UCSD, Spring 2016

Lagrangian methods and Smoothed Particle Hydrodynamics (SPH) Computation in Astrophysics Seminar (Spring 2006) L. J. Dursi

Interaction of Fluid Simulation Based on PhysX Physics Engine. Huibai Wang, Jianfei Wan, Fengquan Zhang

The 3D DSC in Fluid Simulation

AN ADAPTIVE SAMPLING APPROACH TO INCOMPRESSIBLE PARTICLE-BASED FLUID. A Dissertation WOO-SUCK HONG

CUDA. Fluid simulation Lattice Boltzmann Models Cellular Automata

Adarsh Krishnamurthy (cs184-bb) Bela Stepanova (cs184-bs)

CS4621/5621 Fall Particle Systems and Compute Shaders

CS 231. Fluid simulation

IMPROVED WALL BOUNDARY CONDITIONS WITH IMPLICITLY DEFINED WALLS FOR PARTICLE BASED FLUID SIMULATION

A brief description of the particle finite element method (PFEM2). Extensions to free surface

CUDA Particles. Simon Green

T6: Position-Based Simulation Methods in Computer Graphics. Jan Bender Miles Macklin Matthias Müller

Assignment 1: Mass-Spring System

CNM 190, pt 2 Advanced Digital Animation Lec 03 : Art Direction on Madagascar / Effects 1

Hardware Accelerated Real-Time Fluid Surface Simulation

Water. Notes. Free surface. Boundary conditions. This week: extend our 3D flow solver to full 3D water We need to add two things:

Permeable and Absorbent Materials in Fluid Simulations

Fluids in Games. Jim Van Verth Insomniac Games

Solving Partial Differential Equations on Overlapping Grids

Particle-based Fluid Simulation

Solidification using Smoothed Particle Hydrodynamics

Chapter 1 - Basic Equations

A Particle Cellular Automata Model for Fluid Simulations

A Fast and Stable Approach for Restoration of Warped Document Images

Partial Differential Equations

Real Time Cloth Simulation

Lattice Boltzmann with CUDA

An Analysis of Interactive Deformable Solid Object Modeling

Introduction to Computer Graphics. Animation (2) May 26, 2016 Kenshi Takayama

Interactive Fluid Simulation Using Augmented Reality Interface

3D Simulation of Dam-break effect on a Solid Wall using Smoothed Particle Hydrodynamic

Numerical Methods for (Time-Dependent) HJ PDEs

DYNAMIC SIMULATION OF INEXTENSIBLE CLOTH

Demoscene and Maths. Presentation by Konstantinos Pataridis aka Navis/ASD University of Oxford August 2006

ANSYS AIM Tutorial Turbulent Flow Over a Backward Facing Step

(LSS Erlangen, Simon Bogner, Ulrich Rüde, Thomas Pohl, Nils Thürey in collaboration with many more

Chapter 6. Semi-Lagrangian Methods

Structure and Synthesis of Robot Motion

Chapter 3: Computer Animation Reminder: Descriptive animation. Procedural animation : Examples. Towards methods that generate motion?

PPGCC Linha de Pesquisa SIV Disciplina: Animação Computadorizada. Profª. Drª. Soraia Raupp Musse Pós-doc Dr Leandro Dihl 12/05/2015

Parallel Summation of Inter-Particle Forces in SPH

Divergence-Free Smoothed Particle Hydrodynamics

SPH: Why and what for?

Investigating The Stability of The Balance-force Continuum Surface Force Model of Surface Tension In Interfacial Flow

Animation. Itinerary. What is Animation? What is Animation? Animation Methods. Modeling vs. Animation Computer Graphics Lecture 22

Topics in Computer Animation

FEM techniques for interfacial flows

Animation. Itinerary Computer Graphics Lecture 22

Particle Systems. Lecture 8 Taku Komura

CS GPU and GPGPU Programming Lecture 2: Introduction; GPU Architecture 1. Markus Hadwiger, KAUST

Cloth Simulation on the GPU. Cyril Zeller NVIDIA Corporation

Simple and Fast Fluids

CS /15-667: Simulation Methods for Animation and Digital Fabrication

Three Dimensional Numerical Simulation of Turbulent Flow Over Spillways

BACHELOR OF ARTS IN 3D ANIMATION AND VISUAL EFFECTS Term-End Theory Examination December, 2015 BNM-001 : ANIMATION PRODUCTION PIPELINE

Simulation of curly hair

3D Physics Engine for Elastic and Deformable Bodies. Liliya Kharevych and Rafi (Mohammad) Khan Advisor: David Mount

Example 13 - Shock Tube

FLOWING FLUIDS AND PRESSURE VARIATION

Table of contents for: Waves and Mean Flows by Oliver Bühler Cambridge University Press 2009 Monographs on Mechanics. Contents.

MAE 3130: Fluid Mechanics Lecture 5: Fluid Kinematics Spring Dr. Jason Roney Mechanical and Aerospace Engineering

Solution for Euler Equations Lagrangian and Eulerian Descriptions

Fast Multipole Method on the GPU

Computer Animation. Algorithms and Techniques. z< MORGAN KAUFMANN PUBLISHERS. Rick Parent Ohio State University AN IMPRINT OF ELSEVIER SCIENCE

Rigid Body Dynamics, Collision Response, & Deformation

Continued Investigation of Small-Scale Air-Sea Coupled Dynamics Using CBLAST Data

Transcription:

PHYSICALLY BASED ANIMATION CS148 Introduction to Computer Graphics and Imaging David Hyde August 2 nd, 2016

WHAT IS PHYSICS? the study of everything?

WHAT IS COMPUTATION? the study of everything?

OUTLINE I Computational Physics History Today Examples II Fluid Simulation Particle-based simulation Grid-based simulation Using Tools Rendering Considerations III Cloth Simulation Baraff and Witkin

A BRIEF HISTORY OF COMPUTATIONAL PHYSICS

HOW COMPUTATIONAL PHYSICS IS USED TODAY Computational astrophysics

HOW COMPUTATIONAL PHYSICS IS USED TODAY Protein folding / biology

HOW COMPUTATIONAL PHYSICS IS USED TODAY Computational fluid dynamics

HOW COMPUTATIONAL PHYSICS IS USED TODAY Computational fluid dynamics

HOW COMPUTATIONAL PHYSICS IS USED TODAY Graphics

HOW COMPUTATIONAL PHYSICS IS USED TODAY Graphics

HOW COMPUTATIONAL PHYSICS IS USED TODAY Graphics

A SIMPLE COMPUTATIONAL PHYSICS EXAMPLE Simulating an object falling due to gravity: x = x 0 + v 0 Δt + 1 2 aδt2 1. Pick a time step Δt 2. Solve equation to update x 3. Use new x and old x to update v 4. Repeat steps 2-4 Live Demo

MAKING COMPUTATIONAL PHYSICS WORK 1. Figure out what physical laws apply to what you want to simulate (reading, thinking, doing math) 2. Figure out how to solve those equations on a computer (reading, thinking, math) 3. Write a computer program that solves the equations (programming) 4. Debug 5. Make a finished product 1. Render results and make cool pictures/animations (programming, art) 2. Compare to real-world experiments and other people s work (programming, reading) 6. Use results to gain insight into universe and to guide future research

MAKING COMPUTATIONAL PHYSICS WORK 1. Figure out what physical laws apply to what you want to simulate (reading, thinking, doing math) e.g. Navier-Stokes equations (fluid dynamics): u t + u u = 1 ρ തp + ν 2 u + 1 ν u + g 3

MAKING COMPUTATIONAL PHYSICS WORK 2. Figure out how to solve those equations on a computer (reading, thinking, math)

MAKING COMPUTATIONAL PHYSICS WORK 3. Write a computer program that solves the equations (programming)

OUTLINE I Computational Physics History Today Examples II Fluid Simulation Particle-based simulation Grid-based simulation Using Tools Rendering Considerations III Cloth Simulation Baraff and Witkin

PARTICLE-BASED FLUID SIMULATION Demo Video

WALKTHROUGH: PARTICLE-BASED FLUID SIM Why approximate fluid as particles? Simplicity, speed What must a particle know? Position, velocity, mass, density, pressure, force, etc. How do particles move? Newton s second law (F = ma) What next? Write the simulation loop!

WALKTHROUGH: PARTICLE-BASED FLUID SIM The algorithm: Initialize particles For each time step Δt: For each particle p j : Get neighbors N j of p j Compute density at p j from N j Compute pressure at p j from N j Use density, pressure, and other forces like gravity to compute acceleration of p j Update particle velocity and position due to acceleration Correct for collisions Add new particles if necessary (source term) Remove particles if necessary (e.g. outside domain)

WALKTHROUGH: PARTICLE-BASED FLUID SIM Q&A: Initialize particles For each time step Δt: How to choose Δt? For each particle p j : Get neighbors N j of p j How to get neighbors? Smaller = more accurate, larger = faster Naively compute inter-particle distances? Use a kernel, e.g. W d = 1 Acceleration structures? h 2? 3 e r2 π2h 3 Compute density at p j from N j Compute pressure at p j from N j Use density, pressure, and other forces like gravity to compute acceleration of p j Update particle velocity and position due to acceleration How to update? Correct for collisions Add new particles if necessary (e.g. source terms) Remove particles if necessary (e.g. outside domain) Forward Euler? Backward Euler? RK4?

ACCELERATION STRUCTURES FOR SPH SIMS One possible acceleration structure: spatial grid Extension: adaptive grids Quadtrees, octrees

TIME INTEGRATION / 205A FREE PREVIEW How to numerically solve an equation like F = ma? (Assume mass is constant.) Can express above as ordinary differential equation (ODE): dv dt = Fm 1 Forward Euler: vn+1 v n Δt Trivial to solve; unstable Backward Euler: vn+1 v n Δt Requires inversion/iteration to solve; stable = F n m 1 v n+1 = v n + ΔtF n m 1 = F n+1 m 1 v n+1 = v n + ΔtF n+1 m 1 Trapezoidal: vn+1 v n = 1 Δt 2 (Fn + F n+1 )m 1 v n+1 = v n + Δt 2 (Fn + F n+1 )m 1 More?: Higher-order methods etc.

RENDERING SPH FLUID Real fluid is not made of particles Can t simulate infinite number of small particles Demo Video

RENDERING SPH FLUID Make it look more realistic? Lighting, shading Reflection, refraction Foam, turbulence Color by vorticity: demo video

WALKTHROUGH: GRID-BASED FLUID SIM Demo video

WALKTHROUGH: GRID-BASED FLUID SIM The idea: Discretize space into a grid Store fluid quantities at different positions on the grid MAC grid Order of accuracy O Δx, O Δx 2, etc. Update fluid quantities with advection and projection steps

WALKTHROUGH: GRID-BASED FLUID SIM Choosing a time step CFL condition: (constants out in front?) (adaptive time steps?)

WALKTRHOUGH: GRID-BASED FLUID SIM Semi-Lagrangian advection for a fluid quantity Q (e.g. density) (note: Forward Euler)

WALKTRHOUGH: GRID-BASED FLUID SIM Projection and collision handling:

RENDERING EULERIAN FLUID Level set method Initialize level set as signed distance function Solve Eikonal equation φ = 1 Advect level set along with fluid! φ t = v φ Reinitialize level set occasionally Demo Video 1 Demo Video 2

FLUID SIMULATIONS: BRIEF COMPARISON Particle-Based Grid-Based Speed? Faster Slower Parallelization? Trivial Non-trivial Accuracy? Less accurate More accurate Visual appearance? Worse Better

FLUID SIMS: RENDERING CONSIDERATIONS With fluid as triangle mesh, can apply normal mapping

FLUID SIMS: PERFORMANCE CONSIDERATIONS Parallelism GPU? MPI? OpenMP?

LIVE DEMO: FLUID SIMULATION IN MAYA (Show rendered result afterwards)

OUTLINE I Computational Physics History Today Examples II Fluid Simulation Particle-based simulation Grid-based simulation Using Tools Rendering Considerations III Cloth Simulation Baraff and Witkin

SIMULATING CLOTH

A SINGLE MASS-SPRING SYSTEM Live Demo

COUPLED MASS-SPRING SYSTEM

COUPLED MASS-SPRING SYSTEM

SIMULATING CLOTH How to model a piece of cloth? Set of nodes/vertices connected by springs (Hooke s Law: F = kx)

SIMULATING CLOTH How to model a piece of cloth? Apply various forces to cloth/springs Restorative forces to prevent cloth craziness

SIMULATING CLOTH The math Governing ODE: x ሷ = M 1 E x + F where M is mass distribution of cloth, E is cloth s internal energy, and F captures forces like air drag, contact, bending, internal damping, etc. Energy idea: for a (vector) condition C we want to be zero, associate with it an energy function E C x = 1 2 kc x T C(x) (looks like kinetic energy)

SIMULATING CLOTH

SIMULATING CLOTH Implicit (Backward Euler) time integration method Stability means we can take large time steps (h is step size)

SIMULATING CLOTH Collision handling? Demo Video

CONCLUSIONS Physics and computation Particle-based and grid-based fluid simulation Cloth simulation Where to go from here?

THANK YOU! Any questions?