UNIVERSIDADE FEDERAL DO RIO DE JANEIRO Some techniques to Speed up Collision Detection Yalmar Ponce Atencio LCG/PESC/COPPE
UNIVERSIDADE FEDERAL DO RIO DE JANEIRO Problem Given a large environment with moving objects, Detect overlapping objects Overlapping triangles in each pair
UNIVERSIDADE FEDERAL DO RIO DE JANEIRO Goal Interactive collision detection between complex objects Large number of objects High primitive count Non-convex objects Open and closed objects Deformable objects Changing topology
UNIVERSIDADE FEDERAL DO RIO DE JANEIRO Related Work Collision detection Hardware accelerated techniques Object space techniques Two phases Broad phase – Compute object pairs in close proximity Narrow phase – Check each pair for exact collision detection
UNIVERSIDADE FEDERAL DO RIO DE JANEIRO Related Work Broad phase Spatial partitioning Sweep-and-prune Narrow phase Spatial partitioning Bounding volume hierarchies Surveys [ Klosowski 1998, Lin and Manocha 2003, Redon et al. 2002, Andrew Nealen et al ]
UNIVERSIDADE FEDERAL DO RIO DE JANEIRO Limitations of Object-space Techniques Considerable pre-processing Hard to achieve real-time performance on complex deformable models
UNIVERSIDADE FEDERAL DO RIO DE JANEIRO Collision Detection using Graphics Hardware Primitive rasterization – sorting in screen-space Interference tests NV_OCCLUSION_QUERY Requires high screen resolution
UNIVERSIDADE FEDERAL DO RIO DE JANEIRO Image Space Techniques Use of graphics hardware CSG rendering [Goldfeather et al. 1989, Rossignac et al. 1990] Interferences and cross-sections [Baciu et al. 1998, Myszkowski 1995, Rossignac et al. 1992, Shinya and Forgue 1991] Virtual Surgery [Lombardo et al. 1999] Minkowski sums [Kim et al. 2001] Cloth animation [Vassilev et al. 2001] Proximity computation [Hoff et al. 2001, 2002] CULLIDE, R-CULLIDE, Q-CULLIDE[Govindaraju et al ]
UNIVERSIDADE FEDERAL DO RIO DE JANEIRO Limitations of Current Approaches Closed models Frame buffer readbacks – slow
UNIVERSIDADE FEDERAL DO RIO DE JANEIRO Outline Overview Pruning Algorithm HashedOctree Implementation and Results Conclusions and Future Work
UNIVERSIDADE FEDERAL DO RIO DE JANEIRO Outline Overview Pruning Techniques HashedOctree Implementation and Results Conclusions and Future Work
UNIVERSIDADE FEDERAL DO RIO DE JANEIRO Overview Potentially Colliding Set (PCS) computation Exact collision tests on the PCS using a HashedOctree
UNIVERSIDADE FEDERAL DO RIO DE JANEIRO Technique Object Level Pruning Sub-object Level Pruning Exact Tests GPU based PCS computation Using CPU
UNIVERSIDADE FEDERAL DO RIO DE JANEIRO Potentially Colliding Set (PCS) PCS Scene
UNIVERSIDADE FEDERAL DO RIO DE JANEIRO Outline Overview Pruning Techniques HashedOctree Implementation and Results Conclusions and Future Work
UNIVERSIDADE FEDERAL DO RIO DE JANEIRO Pruning Techniques Occlusion queries Back-face culling Convex models View volume culling glSelectBuffer()
UNIVERSIDADE FEDERAL DO RIO DE JANEIRO View volume culling Using AABBs
UNIVERSIDADE FEDERAL DO RIO DE JANEIRO A B Improvements Using OBBs Transform B for A orientation Use OBB B as cliping planes PCS B
UNIVERSIDADE FEDERAL DO RIO DE JANEIRO Outline Overview Pruning Techniques HashedOctree Implementation and Results Conclusions and Future Work
UNIVERSIDADE FEDERAL DO RIO DE JANEIRO Creation Hierarchical Recursively Hash [N.A.Gumerov et al. 2003] From hierarchical Octree or Using a generated Key Key is generated from parent nodes Hash table uses k mod 2 b ( b last bits) Octree x HashedOctree
UNIVERSIDADE FEDERAL DO RIO DE JANEIRO Search in Octree p Hierarchical recursive
UNIVERSIDADE FEDERAL DO RIO DE JANEIRO Search in HashedOctree p Direct access Using key node
UNIVERSIDADE FEDERAL DO RIO DE JANEIRO Outline Overview Pruning Techniques HashedOctree Implementation and Results Conclusions and Future Work
UNIVERSIDADE FEDERAL DO RIO DE JANEIRO HashedOctree Morton key Generated recursively Key is computed using Interleaving k (n) = x l y l z l x l-1 y l-1 z l-1 …x 1 y 1 z 1 l is the level of the octree Interleaving is achieved by “OR”ing
UNIVERSIDADE FEDERAL DO RIO DE JANEIRO B A Potentially Colliding Set x HashedOctree Each object have a HashedOctree PCS B = trgls_in( OBB A OBB B ) Exact test PCS B x HashedOctree A
UNIVERSIDADE FEDERAL DO RIO DE JANEIRO Algorithm CS A = CS B = foreach (t B in PCS B ){ PCS A = foreach (p in t B ) PCS A HashedOctree A.searchElems(p) if (PCS A ) foreach (t A in PCS A ) if (t A t B ){ CS A t A CS B t B }
UNIVERSIDADE FEDERAL DO RIO DE JANEIRO Results
UNIVERSIDADE FEDERAL DO RIO DE JANEIRO Results
UNIVERSIDADE FEDERAL DO RIO DE JANEIRO Results
UNIVERSIDADE FEDERAL DO RIO DE JANEIRO Results
UNIVERSIDADE FEDERAL DO RIO DE JANEIRO Results
UNIVERSIDADE FEDERAL DO RIO DE JANEIRO Results
UNIVERSIDADE FEDERAL DO RIO DE JANEIRO Results
UNIVERSIDADE FEDERAL DO RIO DE JANEIRO Results Tests on a Pentium M 2.0Ghz with ATI X Mb PCIe and 1Gb RAM Hierarchical Octree Depth Level 10 Hashed Octree Depth Level 10 Search a Point Cow 4315 Triangles 8626 Faces 9-11 us us Dragon Triangles Faces us us Exact intersection Triangle-Triangle Torus x Torus 632 Triangles 1264 Faces us 5-39 us Cow x Torus us us
UNIVERSIDADE FEDERAL DO RIO DE JANEIRO Outline Overview Pruning Techniques HashedOctree Implementation and Results Conclusions and Future Work
UNIVERSIDADE FEDERAL DO RIO DE JANEIRO Conclusions and Future Work Conclusions Earlier image based collision detection approaches present some limitations (Screen Resolution). Object level Pruning and Sub-object pruning are required. Hashed Octree reduces a query up to 80% over hierarchical Octree. Future Work Geometric models can be mapped efficiently on images (Geometry Images). Geometry images allow to generate Octrees and volume hierarchies in real-time on current GPUs.
UNIVERSIDADE FEDERAL DO RIO DE JANEIRO Thanks all folks!
UNIVERSIDADE FEDERAL DO RIO DE JANEIRO