Naga K. Govindaraju, Stephane Redon, Ming C. Lin, Dinesh Manocha
description
Transcript of 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
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
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
Problem
Given a large environment with moving objects,
Compute overlapping objectsOverlapping triangles in each pair
Goal
Interactive collision detectionbetween complex objects
Large number of objectsHigh primitive countNon-convex objectsOpen and closed objects
Non-rigid Motion
Deformable objectsChanging topology
Real-time Collision Detection using our Approach
Complex breaking objects on a NVIDIA GeForce FX5800 Ultra GPU
Related WorkObject space techniquesTwo phases
Broad phase – Compute object pairs in close proximity Narrow phase – Check each pair for exact collision detection
Limitations of Object-space Techniques
Considerable pre-processingHard to achieve real-time performance on complex deformable models
Collision Detection using Graphics Hardware
Primitive rasterization – sorting in screen-space
Interference tests
Outline
OverviewPruning AlgorithmImplementation and ResultsConclusions and Future Work
Outline
OverviewPruning AlgorithmImplementation and ResultsConclusions and Future Work
Overview
Potentially Colliding Set (PCS) computationExact collision tests on the PCS
Algorithm
Object LevelPruning
Sub-objectLevel
PruningExact Tests
GPU based PCS computation
Using CPU
Potentially Colliding Set (PCS)
PCS
Potentially Colliding Set (PCS)
PCS
Outline
Problem OverviewOverviewPruning AlgorithmImplementation and ResultsConclusions and Future Work
Algorithm
Object LevelPruning
Sub-object Level
PruningExact Tests
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
set S
Collision Detection using Visibility Computations
Fully VisibleObject O
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
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
PCS Pruning
O1 O2 … Oi-1 Oi
PCS Pruning
Oi Oi+1 … On-1 On
PCS Computation
Each object tested against all objects but itselfNaive algorithm is O(n2)Linear time algorithm
Uses two pass rendering approach
PCS Computation: First Pass
O1 O2 … Oi-1 Oi Oi+1 … On-1 On
Render
PCS Computation: First Pass
Fully Visible?
Render
O1
O1 O2 … Oi-1 Oi
PCS Computation: First Pass
Fully Visible?
Render Yes. Does not collide withO1,O2,…,Oi-1
PCS Computation: First Pass
O1 O2 … Oi-1 Oi Oi+1 … On-1 On
Render
Fully Visible?
PCS Computation: Second Pass
O1 O2 … Oi-1 Oi Oi+1 … On-1 On
Render
On
PCS Computation: Second Pass
Render
Fully Visible?
On
PCS Computation: Second Pass
Render
Fully Visible?
Oi Oi+1 … On-1 On
Yes. Does not collide with Oi+1,…,On-1,On
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
PCS Computation
O1 O2 … Oi-1 Oi Oi+1 … On-1 On
Fully VisibleFully Visible
PCS Computation
O1 O2 O3 … Oi-1 Oi Oi+1 … On-2 On-1 On
O1 O3 … Oi-1 Oi+1 … On-1
ExampleO1
O2
O3
O4Scene with 4 objectsO1and O2 collideO3, O4 do not collide
Initial PCS = { O1,O2,O3,O4 }
O3
O1
First Pass
O2
Order of rendering: O1 O4
O3
Fully Visible
O1
Fully Visible
O4O4
Fully Visible
Not Fully Visible
Second Pass
O1
O3
O2O2
Fully Visible
Order of rendering: O4 O1O4O4
Fully Visible
O3
Fully Visible
Not Fully Visible
After two passesO1
O2
O3
O4
Fully Visible
Fully Visible
Potential Colliding SetO1
O2
PCS ={O1,O2}
Algorithm
Object LevelPruning
Sub-object Level
PruningExact Tests
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
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
Potential Colliding SetO1
O2
PCS = {O1,O2}
O1
Sub-objects
O2
PCS = sub-objects of {O1,O2}
First Pass
Rendering order: Sub-objects of O1 O2
Fully VisibleFirst Pass
Fully Visible First Pass
Fully VisibleFully Visible
Not Fully VisibleFirst Pass
Fully VisibleFully Visible
Fully Visible
First Pass
Fully VisibleFully Visible
Fully Visible
First Pass
Fully VisibleFully Visible
Fully Visible
Fully Visible
First Pass
Second Pass
Rendering order: Sub-objects of O2 O1
Fully Visible
Second Pass
Fully Visible
Second Pass
Fully VisibleSecond Pass
Not Fully VisibleFully Visible
Fully Visible
Fully Visible
Second Pass
Fully Visible
Fully Visible
Fully Visible
Fully VisibleSecond Pass
Fully Visible
Fully Visible
Fully Visible
After two passes
PCS
Algorithm
Object LevelPruning
Sub-objectlevel
PruningExact Tests
Exact Overlap tests using CPU
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
Visibility QueriesDepth function
GEQUAL LESSAll fragments Pass FailPass
FailFailPassFail PassFail
Query not supported
Occlusion query
Examples - HP_Occlusion_test, NV_occlusion_query
Bandwidth Analysis
Read back only integer identifiers
Independent of screen resolution
Optimizations
Use object bounding volumeUse orthographic views for pruning
Outline
OverviewPruning AlgorithmImplementation and ResultsConclusions and Future Work
Implementation
Dell Precision workstationDell M50 Laptop
Test Models: Environment 1
100 deforming cylindersTotal – 20K triangles
Test Models: Environment 2
Deforming toriiEach torus – 20K triangles
Test Model: Environment 3
250K Dragon35K Bunny
Test Model: Environment 4
Breaking dragon – 250K trianglesBunny – 35K triangles
Implementation
Dell Precision workstation, 2.4GHz Pentium IV CPU, NVIDIA GeForce FX 5800 Ultra GPU, 2GB memory running Windows 2000
Performance
Number of objects v/s collision time
(in m
s)
Performance
Number of polygons v/s collision time
(in m
s)
Performance
Screen resolution v/s collision time
(in m
s)
Advantages
No coherenceNo assumptions on motion of objectsWorks on generic modelsA fast pruning algorithmNo frame-buffer readbacks
Limitations
No distance or penetration depth informationResolution issuesNo self-collisionsPerformance varies with relative configurations
Live Demo of Environment 4
Dell M50 laptop, 2.4GHz Pentium IV-M CPU, NVIDIA Quadro4 700GoGL GPU, 1GB memory running Windows XP
Live Demo of Environment 1
Avg. frames per second = 300
Conclusions
Novel algorithm for collision detection using graphics hardware
No assumptions on motionLinear time PCS computation algorithmNo frame buffer readbacks
Conclusions
First practical solution for general deformable models and breaking objects
Future Work
Handle self-collisionsApply to more interactive applicationsDistance and penetration depth computation