Physics-Based Modeling Ming C. Lin Department of Computer Science University of North Carolina lin...

Post on 19-Dec-2015

222 views 0 download

Tags:

Transcript of Physics-Based Modeling Ming C. Lin Department of Computer Science University of North Carolina lin...

Physics-Based Modeling

Ming C. Lin Department of Computer Science

University of North Carolinahttp://www.cs.unc.edu/~lin

http://www.cs.unc.edu/~geomlin@cs.unc.edu

New Needs

Add more realistic and higher fidelity simulations, especially for urban simulations/scenarios.

Physics-based computations: weather effects, explosions, entity simulation, spatialized sound effects, shadows, environmental effects, etc.

Require modeling/simulation of civilians: “heterogeneous crowds”

Some Issues

Performance vs. FidelityValidation and VerificationAssessment & Evaluation

– “Correct training”– Performance enhancement– Cost saving

Speed vs. Fidelity/Accuracy

Multiresolution framework Perception-basedData driven + Physics + New Math

High Energy Fluid-Elastic Interaction

Fluid phenomena everywhere in real worldSource of interesting phenomena – from

interaction and fluid itself

Introduction

Fluid notoriously difficult to simulate– Mathematically:

• Nonlinear• Characteristics travel with high or infinite

speed

– Computationally:• Volume discretization• Stability problems• Resists paralleization

Introduction

Fluid-solid interaction difficult:– Fluid typically Eulerian– Solid objects typically Lagrangian

Interaction introduces severe meshing problems

Our Approach

We want to simulate interaction of fluids & solids– Do it at high fluid energy levels– “Solid” bodies enter elastic regime

We want a method that is fast and capable of handling high-energy fluids

We need to handle meshing issues

Our Approach

Fast -> parallel– Parallel means local operators

Residual distribution schemes (RDS)– A technique developed in aeronautical

community for simulating the Euler equations. [Roe '81]

Very simple, local stencils based on wave models of problem equation.

Residual Distribution Schemes

Consider simple 1D passive advection:

t1

t0

ut=au

x

Residual Distribution Schemes

Each discrete cell moves along a characteristic

Think of the characteristic as a “signal” that is

sent to the next cell

At each timestep, each cell sends a portion of

its value to the next cell

Residual Distribution SchemesIn RDS, each signal is derived from the residual

(or fluctuation) of the equation over each cell.

This example is very simple – we have

constant-speed advection

Burger's Equation

Nonlinear extension to linear advection– Characteristics depend on unknowns

ut=uu

x

RDS Procedure

For each cell:– Compute fluctuation, decompose into

waves– Distribute waves to incident nodes

• Accumulate updates

For each node:– Time-integrate updates

RDS Procedure

Lends itself to parallelization:– Perform cell computation in parallel

• Atomic node accumulation

– Barrier– Perform node integration in parallel– Barrier

Elasticity

We use a standard FEM model of linear elasticity for solid objects.

Iterative solve (conjugate gradient) for new displacements– Parts of CG amenable to parallelization

RDS-based elasticity (in progress)

Mesh Wrangling

Elastic solve does not take fluid domain mesh into account– Elastic deformations likely to invert fluid

tetrahedra. We use a weakly stiff elasticity on the

fluid tetrahedra to enforce postive volumes

Practical and cheap

Mesh Refinement

Semi-regular refinement splits tets into 8 children– 4 similar– 4 others

Currently only static in use – Suitable for multigrid, etc.

Dynamic in progress

Results

Results

Results

Results - Timing

Interactive fluid solution speeds.Finite element method elasticity

bottleneck

Results - Scaling

RDS very scalable - residuals can be computed and distributed independently.

Multi-core scaling

of RDS solve for

skyscraper scene

Ongoing/Future Efforts

RDS for elasticity solves – clean solution, parallelizable.

GPU implementation of RDS.More advanced mesh management

for topological changes in domain.

Modeling of Soft Articulated Bodies in Contact Using Dynamic Deformation Textures

Motivation

Global deformations Detailed deformations

Müller et al. ‘05Barbič & James ‘05 Ours

Motivation

Dynamic simulation of deformable solids Highly detailed surface geometry Large contact area: objects bounce, roll, slide,…

Layered Models Motivation

Detailed, small-scale deformationsGlobal (skeletal) deformationsDynamic interplay between skeletal

motion and surface deformation during contact

Layered Models

Overview– Dynamic Deformation Textures

Fast Coupled Layered DynamicsFast Condensed Skeleton Dynamics

Layered Models

Overview– Dynamic Deformation Textures

Fast Coupled Layered DynamicsFast Condensed Skeleton Dynamics

Layered Models

S

C

S

C

Layered ModelsDynamic Deformation Textures

Dynamic DeformationTexture

S

C

Layered Models

Overview– Dynamic Deformation Textures

Fast Coupled Layered DynamicsFast Condensed Skeleton Dynamics

Fast Coupled Layered Dynamics

Generalized Lagrangian frameworkLinear elasticity in moving frame of

reference [Terzopoulos&Witkin’88]

FEM discretizationImplicit integrationPhysically based approximations

Dynamic FormulationDecoupled Solution

1. Project surface forces to update core velocity

2. Distribute core velocity to update surface velocities

Motion interaction Heterogeneous material

Cylinder: 161K tetrahedra

Fast & Responsive Contact

Hierarchical Collision Queries– Texture-based Collision Detection

Responsive Contact HandlingFast Coupled Contact Response

– Skeleton Response Anticipation

Texture-based Collision Detection

Texture-based Collision DetectionStage 1: Low-resolution

Fast proximity tests between proxiesContact plane D per contact region

D

Surface projection onto contact plane DIdentify contacts in D from separation

distances

D

Texture-based Collision DetectionStage 2: Detailed Surface Interference

D

GPU-based

Texture-based Collision DetectionCollision Information Transfer

Contact response in dynamic deformation texture

Transfer collision information

D

DGPU Texture Mapping

T

Hierarchical Pruning

Exploit skeletal nature of deformation– Locality

Robust 2-stage collision detection

Gear: 173K tetrahedra Cylinder: 161K tetrahedra

Articulated Contact Response

Snake: 3,102 surface points 16 bones

Highly detailed, dynamic deformations

Head: 240K tetrahedra 40K vertices

Highly detailed, dynamic deformations

Exploiting Parallelism

All surface-related computations on GPUCommunication between core and

surface computations minimizedDynamic deformation textures for

immediate rendering

Fast Contact Modeling for Soft Characters

Deer: 2,755 surface points 34 bones 10 FPS

Sound in Nature

Collisions lead to surface vibrationsVibrations create pressure waves in airPressure waves are sensed by ear

Vibration Pressure Wave Perception

Physically Based Sound Synthesis

Aim: Generate Sounds directly from physical principles

Current: Recorded SoundsProblems with recorded sounds:

– Difficult, expensive or dangerous to record (eg. Explosions)

– Repetitiveness

* Image taken from: http://www.marblehead.net/foley/index.html

A typical foley studio*

Perceptually Based Acceleration

Brute force physical simulation infeasible Use analytical solution for surface dynamics Exploit human auditory perception

– Mode Compression– Mode Truncation– Quality Scaling

Key Characteristics

Discretized physically-based representation Simplicity of formulation and ease of

implementation; No assumptions about the input mesh topology

– Surface meshes used for physics can be used directly for sound

Capable of yielding both impact and rolling sounds Enables rich environments consisting of numerous

sounding objects, with insignificant difference in the overall audio quality

System Demonstration

Video

[Raghuvanshi & Lin; I3D 2006]

Motivation: Acoustics

The acoustics of a scene contribute a lot to the immersion and realism

More generally, wave propagation has applications in diverse areas:

- Radio waves (Electromagnetic)

- Sonar

- Seismic Waves (Earthquakes)

Problem Statement

Given: An arbitrary scene in 3D, the locations and sounds for many moving sound sources and the location of the listener (dynamic)

Evaluate the sound heard by the listener as efficiently as possible

Challenges

Need full time-domain solutionMultiple reflections (>10) are

perceptually relevantAudible sounds (20-22000 Hz) have

wavelengths ~cm: Diffraction is important

Sound is coherent: Interference is also important

Approaches

Mainly two types of approaches:– Ray/Beam-based–Wave-based

Ray-based approaches motivated from light simulation– Trace sound rays/packets of rays/beams– Compute-intensive for higher order reflections– Integrating diffraction accurately is tough

Approaches (contd..)

Wave-based approaches directly solve the underlying physical equations

Discretize the equations using an FEM/FDM based approach

Capture reflection, interference and diffraction accurately

Computationally Intractable, especially for high frequencies– Most current methods limited to ~100 Hz

Our approach

Wave-based approach: Solve the Wave Equation:

is the laplacian operator in 3D = 340m/s is the speed of sound is the pressure field to solve for

The RHS is the forcing term, corrsponding to sound sources in the scene

Our approach (contd..)

We discretize the Laplacian Operator using an FDM-based approach, giving a discrete set of equations in time:

Observation: This set of equations can be solved analytically by diagonalizing the Discrete Laplacian Matrix, K

Our approach (contd..)

Main Computational Challenge: Diagonalization has complexity O(n3)

For a typical scene in 3D:

n ~ (lvmax/c)3

l: Diameter of the scene, vmax: Maximum simulated frequency, c: speed of sound

That is, the running time:

T ~ (lvmax/c)9 !!

Our approach (contd..)

Divide and conquer Divide the scene into many partitions Employ analytical solution within

partitions (very efficient at runtime) Apply perceptually based optimizations to

further increase performance Use a simple explicit scheme between

partitions

Performance Benchmark

A typical training environmentRuns at near-real-time performance Simulation frequencies upto 1KHzSystem: Intel Core 2 Duo 2.33 GHz, 2

GB RAM, Nvidia 7950 GTX Graphics

Demo

Visualization of the sound field on the same game environment

The pressure amplitude is color-codedThe input sound is a 200 Hz sine pulseNote the heavy amount of diffraction,

interference and reflection in the simulation

Ongoing/Future Efforts

Increase efficiency to handle 3D scenes in real time– Exploit recent advances in

many-core/parallel hardwareEmploy perceptually based techniques

to make approach more scalableExtend approach to handle dynamic

scenes

Hardware Acceleration

Programmable GPUMany-Core Architecture

Portable Simulation in a Box

Integrate physics-based simulation and develop embedded systems– e.g. On a 30GB flash card, squeeze all

simulation technologies into it and integrated with applications.

The End

Questions?