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 happens After 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 levels Penetration depth should be reported to the handling process The research issue for computational geometry and algorithms
Problem Given a large environment with moving objects, Compute overlapping objects Overlapping triangles in each pair
Goal Interactive collision detection between complex objects Large number of objects High primitive count Non-convex objects Open and closed objects
Non-rigid Motion Deformable objects Changing topology
Real-time Collision Detection using our Approach Complex breaking objects on a NVIDIA GeForce FX5800 Ultra GPU
Related Work Object space techniques Two 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-processing Hard to achieve real-time performance on complex deformable models
Collision Detection using Graphics Hardware Primitive rasterization – sorting in screen-space Interference tests
Outline Overview Pruning Algorithm Implementation and Results Conclusions and Future Work
Outline Overview Pruning Algorithm Implementation and Results Conclusions and Future Work
Overview Potentially Colliding Set (PCS) computation Exact collision tests on the PCS
Algorithm Object Level Pruning Sub-object Level Pruning Exact Tests GPU based PCS computation Using CPU
Potentially Colliding Set (PCS) PCS
Potentially Colliding Set (PCS) PCS
Outline Problem Overview Overview Pruning Algorithm Implementation and Results Conclusions and Future Work
Algorithm Object Level Pruning Sub-object Level Pruning Exact 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 Visible Object O
PCS Pruning Lemma 2: Given n objects O 1,O 2,…,O n, an object O i does not belong to PCS if it does not collide with O 1,…,O i-1,O i+1,…,O n Prune objects that do not collide
PCS Pruning O 1 O 2 … O i-1 O i O i+1 … O n-1 O n
PCS Pruning O 1 O 2 … O i-1 O i
PCS Pruning O i O i+1 … O n-1 O n
PCS Computation Each object tested against all objects but itself Naive algorithm is O(n 2 ) Linear time algorithm Uses two pass rendering approach
PCS Computation: First Pass O 1 O 2 … O i-1 O i O i+1 … O n-1 O n Render
PCS Computation: First Pass Fully Visible? Render O1O1
PCS Computation: First Pass Fully Visible? Render O 1 O 2 Yes. Does not collide with O 1
O 1 O 2 … O i-1 O i PCS Computation: First Pass Fully Visible? Render Yes. Does not collide with O 1,O 2,…,O i-1
PCS Computation: First Pass O 1 O 2 … O i-1 O i O i+1 … O n-1 O n Render Fully Visible?
PCS Computation: Second Pass O 1 O 2 … O i-1 O i O i+1 … O n-1 O n Render O n
PCS Computation: Second Pass Render Fully Visible? O n
PCS Computation: Second Pass Render Fully Visible? O n-1 O n Yes. Does not collide with O n
PCS Computation: Second Pass Render Fully Visible? O i O i+1 … O n-1 O n Yes. Does not collide with O i+1,…,O n-1,O n
PCS Computation: Second Pass Render Fully Visible? O 1 O 2 … O i-1 O i O i+1 … O n-1 O n Yes. Does not collide with O 1,…,O n-1,O n
PCS Computation O 1 O 2 … O i-1 O i O i+1 … O n-1 O n Fully Visible
PCS Computation O 1 O 2 O 3 … O i-1 O i O i+1 … O n-2 O n-1 O n O 1 O 3 … O i-1 O i+1 … O n-1
Example O1O1 O2O2 O3O3 O4O4 Scene with 4 objects O 1 and O 2 collide O 3, O 4 do not collide Initial PCS = { O 1,O 2,O 3, O 4 }
O3O3 O1O1 First Pass O2O2 Order of rendering: O 1 O 4 O3O3 Fully Visible O1O1 O4O4 O4O4 Not Fully Visible
Second Pass O1O1 O3O3 O2O2 O2O2 Fully Visible Order of rendering: O 4 O 1 O4O4 O4O4 Fully Visible O3O3 Not Fully Visible
After two passes O1O1 O2O2 O3O3 O4O4 Fully Visible
Potential Colliding Set O1O1 O2O2 PCS ={O 1,O 2 }
Algorithm Object Level Pruning Sub-object Level Pruning Exact Tests
Overlap Localization Each object is composed of sub- objects We are given n objects O 1,…,O n Compute sub-objects of an object O i that overlap with sub-objects of other objects
Overlap Localization Our solution Test if each sub-object of O i overlaps with sub-objects of O 1,..O i-1 Test if each sub-object of O i overlaps with sub-objects of O i+1,...,O n Linear time algorithm Extend the two pass approach
Overlap Localization O 1 O 2 … O i-1 O i O i+1 … O n-1 O n PCS Sub-objects
Overlap Localization: First Pass O 1 O 2 … O i-1 O i O i+1 … O n-1 O n Render sub-objects
Overlap Localization: First Pass O 1 O 2 … O i-1 O i Rendered sub-objects Render sub-objects
Overlap Localization: First Pass O 1 O 2 … O i-1 Fully Visible? Rendered sub-objects Render sub-objects
Overlap Localization: First Pass O 1 O 2 … O i-1 Fully Visible? Rendered sub-objects Render sub-objects
Overlap Localization: First Pass Rendered sub-objects O 1 O 2 … O i-1 Fully Visible? Yes. Does not collides with sub-objects of O 1,O 2,…,O i-1 Render sub-objects
Overlap Localization: First Pass Rendered sub-objects O 1 O 2 … O i-1 Fully Visible? Avoids self-collisions! Render sub-objects
Overlap Localization: First Pass O 1 O 2 … O i-1 O i Rendered sub-objects Render sub-objects
Overlap Localization: First Pass O 1 O 2 … O i-1 O i O i+1 … O n-1 O n Rendered sub-objects
Overlap Localization: Second Pass O 1 O 2 … O i-1 O i O i+1 … O n-1 O n Render sub-objects
Overlap Localization O 1 O 2 … O i-1 O i O i+1 … O n-1 O n Sub-objects
Potential Colliding Set O1O1 O2O2 PCS = {O 1,O 2 }
O1O1 Sub-objects O2O2 PCS = sub-objects of {O 1,O 2 }
First Pass Rendering order: Sub-objects of O 1 O 2
Fully Visible First Pass
Fully Visible First Pass
Fully Visible Not Fully Visible First Pass
Fully Visible First Pass
Fully Visible First Pass
Fully Visible First Pass
Second Pass Rendering order: Sub-objects of O 2 O 1
Fully Visible Second Pass
Fully Visible Second Pass
Fully Visible Second Pass
Not Fully Visible Fully Visible Second Pass
Fully Visible Second Pass
Fully Visible After two passes
PCS
Algorithm Object Level Pruning Sub-object level Pruning Exact Tests Exact Overlap tests using CPU
Visibility Queries We require a query Tests if a primitive is fully visible or not Current hardware supports occlusion queries Test if a primitive is visible or not
Visibility Queries Depth function GEQUALLESS All fragments Pass FailPass Fail PassFailPassFail 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 volume Use orthographic views for pruning
Outline Overview Pruning Algorithm Implementation and Results Conclusions and Future Work
Implementation Dell Precision workstation Dell M50 Laptop
Test Models: Environment deforming cylinders Total – 20K triangles
Test Models: Environment 2 Deforming torii Each torus – 20K triangles
Test Model: Environment 3 250K Dragon 35K Bunny
Test Model: Environment 4 Breaking dragon – 250K triangles Bunny – 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 ms)
Performance Number of polygons v/s collision time (in ms)
Performance Screen resolution v/s collision time (in ms)
Advantages No coherence No assumptions on motion of objects Works on generic models A fast pruning algorithm No frame-buffer readbacks
Limitations No distance or penetration depth information Resolution issues No self-collisions Performance 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 motion Linear time PCS computation algorithm No frame buffer readbacks
Conclusions First practical solution for general deformable models and breaking objects
Future Work Handle self-collisions Apply to more interactive applications Distance and penetration depth computation