naga k. govindaraju, stephane redon, ming c. lin, dinesh manocha

82
Adapted from: CULLIDE: Interactive Collision Detection Between Complex Models in Large Environments using Graphics Hardware Naga K. Govindaraju, Stephane Redon, Ming C. Lin, Dinesh Manocha University of North Carolina at Chapel Hill

Upload: manon

Post on 23-Mar-2016

31 views

Category:

Documents


0 download

DESCRIPTION

Adapted from: CULLIDE: Interactive Collision Detection Between Complex Models in Large Environments using Graphics Hardware. Naga K. Govindaraju, Stephane Redon, Ming C. Lin, Dinesh Manocha University of North Carolina at Chapel Hill. Collision Handling. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Adapted from:CULLIDE: Interactive Collision Detection Between Complex Models in Large Environments using Graphics Hardware

Naga K. Govindaraju, Stephane Redon, Ming C. Lin, Dinesh Manocha

University of North Carolina at Chapel Hill

Page 2: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Collision Handling

Contact and collision between objects and between interactive tools with objects Non-trivial to simulate collision, main problems are

Automatically report when collision happensAfter collision detection, objects response in a natural way

Page 3: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Collision Handling

A wide range of techniques are used in collision detection on geometric models

Hierarchical trees formed with bounding boxes or spheres for efficient detect in different levelsPenetration depth should be reported to the handling processThe research issue for computational geometry and algorithms

Page 4: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Problem

Given a large environment with moving objects,

Compute overlapping objectsOverlapping triangles in each pair

Page 5: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Goal

Interactive collision detectionbetween complex objects

Large number of objectsHigh primitive countNon-convex objectsOpen and closed objects

Page 6: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Non-rigid Motion

Deformable objectsChanging topology

Page 7: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Real-time Collision Detection using our Approach

Complex breaking objects on a NVIDIA GeForce FX5800 Ultra GPU

Page 8: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Related WorkObject space techniquesTwo phases

Broad phase – Compute object pairs in close proximity Narrow phase – Check each pair for exact collision detection

Page 9: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Limitations of Object-space Techniques

Considerable pre-processingHard to achieve real-time performance on complex deformable models

Page 10: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Collision Detection using Graphics Hardware

Primitive rasterization – sorting in screen-space

Interference tests

Page 11: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Outline

OverviewPruning AlgorithmImplementation and ResultsConclusions and Future Work

Page 12: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Outline

OverviewPruning AlgorithmImplementation and ResultsConclusions and Future Work

Page 13: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Overview

Potentially Colliding Set (PCS) computationExact collision tests on the PCS

Page 14: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Algorithm

Object LevelPruning

Sub-objectLevel

PruningExact Tests

GPU based PCS computation

Using CPU

Page 15: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Potentially Colliding Set (PCS)

PCS

Page 16: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Potentially Colliding Set (PCS)

PCS

Page 17: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Outline

Problem OverviewOverviewPruning AlgorithmImplementation and ResultsConclusions and Future Work

Page 18: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Algorithm

Object LevelPruning

Sub-object Level

PruningExact Tests

Page 19: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Visibility Computations

Lemma 1: An object O does not collide with a set of objects S if O is fully visible with respect to S

Utilize visibility for PCS computation

Page 20: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

set S

Collision Detection using Visibility Computations

Fully VisibleObject O

Page 21: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

PCS Pruning

Lemma 2: Given n objectsO1,O2,…,On , an object Oi does notbelong to PCS if it does notcollide with O1,…,Oi-1,Oi+1,…,On

Prune objects that do not collide

Page 22: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

PCS Pruning

O1 O2 … Oi-1 Oi Oi+1 … On-1 OnO1 O2 … Oi-1 Oi Oi+1 … On-1 OnO1 O2 … Oi-1 Oi Oi+1 … On-1 On

Page 23: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

PCS Pruning

O1 O2 … Oi-1 Oi

Page 24: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

PCS Pruning

Oi Oi+1 … On-1 On

Page 25: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

PCS Computation

Each object tested against all objects but itselfNaive algorithm is O(n2)Linear time algorithm

Uses two pass rendering approach

Page 26: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

PCS Computation: First Pass

O1 O2 … Oi-1 Oi Oi+1 … On-1 On

Render

Page 27: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

PCS Computation: First Pass

Fully Visible?

Render

O1

Page 28: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

O1 O2 … Oi-1 Oi

PCS Computation: First Pass

Fully Visible?

Render Yes. Does not collide withO1,O2,…,Oi-1

Page 29: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

PCS Computation: First Pass

O1 O2 … Oi-1 Oi Oi+1 … On-1 On

Render

Fully Visible?

Page 30: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

PCS Computation: Second Pass

O1 O2 … Oi-1 Oi Oi+1 … On-1 On

Render

On

Page 31: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

PCS Computation: Second Pass

Render

Fully Visible?

On

Page 32: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

PCS Computation: Second Pass

Render

Fully Visible?

Oi Oi+1 … On-1 On

Yes. Does not collide with Oi+1,…,On-1,On

Page 33: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

PCS Computation: Second Pass

Render

Fully Visible?

O1 O2 … Oi-1 Oi Oi+1 … On-1 On

Yes. Does not collide with O1,…,On-1,On

Page 34: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

PCS Computation

O1 O2 … Oi-1 Oi Oi+1 … On-1 On

Fully VisibleFully Visible

Page 35: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

PCS Computation

O1 O2 O3 … Oi-1 Oi Oi+1 … On-2 On-1 On

O1 O3 … Oi-1 Oi+1 … On-1

Page 36: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

ExampleO1

O2

O3

O4Scene with 4 objectsO1and O2 collideO3, O4 do not collide

Initial PCS = { O1,O2,O3,O4 }

Page 37: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

O3

O1

First Pass

O2

Order of rendering: O1 O4

O3

Fully Visible

O1

Fully Visible

O4O4

Fully Visible

Not Fully Visible

Page 38: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Second Pass

O1

O3

O2O2

Fully Visible

Order of rendering: O4 O1O4O4

Fully Visible

O3

Fully Visible

Not Fully Visible

Page 39: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

After two passesO1

O2

O3

O4

Fully Visible

Fully Visible

Page 40: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Potential Colliding SetO1

O2

PCS ={O1,O2}

Page 41: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Algorithm

Object LevelPruning

Sub-object Level

PruningExact Tests

Page 42: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Overlap LocalizationEach object is composed of sub-objectsWe are given n objects O1,…,On

Compute sub-objects of an object Oi that overlap with sub-objects of other objects

Page 43: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Overlap LocalizationOur solution

Test if each sub-object of Oi overlaps with sub-objects of O1,..Oi-1

Test if each sub-object of Oi overlaps with sub-objects of Oi+1,...,On

Linear time algorithmExtend the two pass approach

Page 44: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Potential Colliding SetO1

O2

PCS = {O1,O2}

Page 45: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

O1

Sub-objects

O2

PCS = sub-objects of {O1,O2}

Page 46: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

First Pass

Rendering order: Sub-objects of O1 O2

Page 47: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Fully VisibleFirst Pass

Page 48: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Fully Visible First Pass

Page 49: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Fully VisibleFully Visible

Not Fully VisibleFirst Pass

Page 50: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Fully VisibleFully Visible

Fully Visible

First Pass

Page 51: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Fully VisibleFully Visible

Fully Visible

First Pass

Page 52: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Fully VisibleFully Visible

Fully Visible

Fully Visible

First Pass

Page 53: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Second Pass

Rendering order: Sub-objects of O2 O1

Page 54: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Fully Visible

Second Pass

Page 55: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Fully Visible

Second Pass

Page 56: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Fully VisibleSecond Pass

Page 57: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Not Fully VisibleFully Visible

Fully Visible

Fully Visible

Second Pass

Page 58: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Fully Visible

Fully Visible

Fully Visible

Fully VisibleSecond Pass

Page 59: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Fully Visible

Fully Visible

Fully Visible

After two passes

Page 60: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

PCS

Page 61: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Algorithm

Object LevelPruning

Sub-objectlevel

PruningExact Tests

Exact Overlap tests using CPU

Page 62: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Visibility Queries

We require a queryTests if a primitive is fully visible or not

Current hardware supports occlusion queries

Test if a primitive is visible or not

Page 63: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Visibility QueriesDepth function

GEQUAL LESSAll fragments Pass FailPass

FailFailPassFail PassFail

Query not supported

Occlusion query

Examples - HP_Occlusion_test, NV_occlusion_query

Page 64: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Bandwidth Analysis

Read back only integer identifiers

Independent of screen resolution

Page 65: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Optimizations

Use object bounding volumeUse orthographic views for pruning

Page 66: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Outline

OverviewPruning AlgorithmImplementation and ResultsConclusions and Future Work

Page 67: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Implementation

Dell Precision workstationDell M50 Laptop

Page 68: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Test Models: Environment 1

100 deforming cylindersTotal – 20K triangles

Page 69: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Test Models: Environment 2

Deforming toriiEach torus – 20K triangles

Page 70: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Test Model: Environment 3

250K Dragon35K Bunny

Page 71: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Test Model: Environment 4

Breaking dragon – 250K trianglesBunny – 35K triangles

Page 72: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Implementation

Dell Precision workstation, 2.4GHz Pentium IV CPU, NVIDIA GeForce FX 5800 Ultra GPU, 2GB memory running Windows 2000

Page 73: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Performance

Number of objects v/s collision time

(in m

s)

Page 74: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Performance

Number of polygons v/s collision time

(in m

s)

Page 75: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Performance

Screen resolution v/s collision time

(in m

s)

Page 76: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Advantages

No coherenceNo assumptions on motion of objectsWorks on generic modelsA fast pruning algorithmNo frame-buffer readbacks

Page 77: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Limitations

No distance or penetration depth informationResolution issuesNo self-collisionsPerformance varies with relative configurations

Page 78: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Live Demo of Environment 4

Dell M50 laptop, 2.4GHz Pentium IV-M CPU, NVIDIA Quadro4 700GoGL GPU, 1GB memory running Windows XP

Page 79: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Live Demo of Environment 1

Avg. frames per second = 300

Page 80: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Conclusions

Novel algorithm for collision detection using graphics hardware

No assumptions on motionLinear time PCS computation algorithmNo frame buffer readbacks

Page 81: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Conclusions

First practical solution for general deformable models and breaking objects

Page 82: Naga K. Govindaraju, Stephane Redon,  Ming C. Lin, Dinesh Manocha

Future Work

Handle self-collisionsApply to more interactive applicationsDistance and penetration depth computation