Содержание
- 2. Overview Quick Background CPU Methods CULLIDE RCULLIDE QCULLIDE CUDA Methods
- 3. Background Need to find collisions for lots of reasons Physics engines Seeing if a projectile hits
- 4. Background Broad phase: Looks at entire scene Looks at proxy geometry (bounding shapes) Determines if two
- 5. Background Narrow phase: Looks at pairs of objects flagged by broad phase Looks at the actual
- 6. Background Resolution Compute forces according to the contact points returned from the narrow phase Can be
- 7. CPU Methods Brute Force Check every object against every other N(N-1)/2 tests O(N²) Sweep and Prune
- 8. Sweep and Prune Bounding volume is projected onto x, y, z axis Determine collision interval for
- 9. Spatial Subdivisions 1 2 3 4 5 6 7 8 Images from pg 699, 700 GPU
- 10. CULLIDE Came out of Dinesh’s group at UNC in 2003 Uses graphics hardware to do a
- 11. Outline Overview Pruning Algorithm Implementation and Results Conclusions and Future Work
- 12. Outline Overview Pruning Algorithm Implementation and Results Conclusions and Future Work
- 13. Overview Potentially Colliding Set (PCS) computation Exact collision tests on the PCS
- 14. Algorithm Object Level Pruning Sub-object Level Pruning Exact Tests
- 15. Potentially Colliding Set (PCS)
- 16. Potentially Colliding Set (PCS) PCS
- 17. Outline Problem Overview Overview Pruning Algorithm Implementation and Results Conclusions and Future Work
- 18. Algorithm Object Level Pruning Sub-object Level Pruning Exact Tests
- 19. Visibility Computations Lemma 1: An object O does not collide with a set of objects S
- 20. Collision Detection using Visibility Computations
- 21. PCS Pruning Lemma 2: Given n objects O1,O2,…,On , an object Oi does not belong to
- 22. PCS Pruning O1 O2 … Oi-1 Oi Oi+1 … On-1 On O1 O2 … Oi-1 Oi
- 23. PCS Pruning O1 O2 … Oi-1 Oi
- 24. PCS Pruning Oi Oi+1 … On-1 On
- 25. PCS Computation Each object tested against all objects but itself Naive algorithm is O(n2) Linear time
- 26. PCS Computation: First Pass O1 O2 … Oi-1 Oi Oi+1 … On-1 On
- 27. PCS Computation: First Pass O1
- 28. PCS Computation: First Pass O1 O2
- 29. O1 O2 … Oi-1 Oi PCS Computation: First Pass
- 30. PCS Computation: First Pass O1 O2 … Oi-1 Oi Oi+1 … On-1 On
- 31. PCS Computation: Second Pass O1 O2 … Oi-1 Oi Oi+1 … On-1 On On
- 32. PCS Computation: Second Pass On
- 33. PCS Computation: Second Pass On-1 On
- 34. PCS Computation: Second Pass Oi Oi+1 … On-1 On
- 35. PCS Computation: Second Pass Fully Visible? O1 O2 … Oi-1 Oi Oi+1 … On-1 On
- 36. PCS Computation O1 O2 … Oi-1 Oi Oi+1 … On-1 On
- 37. PCS Computation O1 O3 … Oi-1 Oi+1 … On-1
- 38. Example O1 O2 O3 O4 Scene with 4 objects O1and O2 collide O3, O4 do not
- 39. O3 O1 First Pass O2 Order of rendering: O1 O4 O4
- 40. Second Pass O1 O3 O2 Order of rendering: O4 O1 O4
- 41. After two passes O1 O2 O3 O4
- 42. Potential Colliding Set O1 O2 PCS ={O1,O2}
- 43. Algorithm Object Level Pruning Sub-object Level Pruning Exact Tests
- 44. Overlap Localization Each object is composed of sub-objects We are given n objects O1,…,On Compute sub-objects
- 45. Overlap Localization Our solution Test if each sub-object of Oi overlaps with sub-objects of O1,..Oi-1 Test
- 46. Overlap Localization Sub-objects
- 47. Overlap Localization: First Pass O1 O2 … Oi-1 Oi Oi+1 … On-1 On
- 48. Overlap Localization: First Pass O1 O2 … Oi-1 Oi Rendered sub-objects
- 49. Overlap Localization: First Pass O1 O2 … Oi-1 Rendered sub-objects
- 50. Overlap Localization: First Pass O1 O2 … Oi-1 Rendered sub-objects
- 51. Overlap Localization: First Pass Rendered sub-objects O1 O2 … Oi-1
- 52. Overlap Localization: First Pass Rendered sub-objects O1 O2 … Oi-1
- 53. Overlap Localization: First Pass O1 O2 … Oi-1 Oi Rendered sub-objects
- 54. Overlap Localization: First Pass O1 O2 … Oi-1 Oi Oi+1 … On-1 On Rendered sub-objects
- 55. Overlap Localization: Second Pass O1 O2 … Oi-1 Oi Oi+1 … On-1 On
- 56. Overlap Localization O1 O2 … Oi-1 Oi Oi+1 … On-1 On Sub-objects
- 57. Potential Colliding Set O1 O2 PCS = {O1,O2}
- 58. O1 Sub-objects O2 PCS = sub-objects of {O1,O2}
- 59. First Pass Rendering order: Sub-objects of O1 O2
- 60. First Pass
- 61. First Pass
- 62. First Pass
- 63. First Pass
- 64. First Pass
- 65. First Pass
- 66. Second Pass Rendering order: Sub-objects of O2 O1
- 67. Second Pass
- 68. Second Pass
- 69. Second Pass
- 70. Fully Visible Second Pass
- 71. Fully Visible Second Pass
- 72. After two passes
- 73. PCS
- 74. Algorithm Object Level Pruning Sub-object level Pruning Exact Tests Exact Overlap tests using CPU
- 75. Visibility Queries We require a query Tests if a primitive is fully visible or not Current
- 76. Visibility Queries Depth function GEQUAL LESS All fragments Pass Examples - HP_Occlusion_test, NV_occlusion_query
- 77. Bandwidth Analysis Read back only integer identifiers Independent of screen resolution
- 78. Optimizations First use AABBs as object bounding volume Use orthographic views for pruning Prune using original
- 79. Advantages No coherence No assumptions on motion of objects Works on generic models A fast pruning
- 80. Limitations No distance or penetration depth information Resolution issues No self-collisions Culling performance varies with relative
- 81. Assumptions Makes assumptions that their algorithm will get faster as hardware improves. Luckily they were right
- 82. RCULLIDE An improvement on CULLIDE in 2004 Resolves issue of screen resolution precision
- 83. Overview A main issue with CULLIDE was the fact that it wasn’t reliable Collisions could easily
- 84. Overview 3 kinds of error associated with visibility based overlap Perspective error Strange shapes from the
- 85. Reliable Queries The three errors cause the following: A fragment to not be rasterized A fragment
- 86. Reliable Queries Use “fat” triangles Generate 2 fragments for each pixel touched by a triangle (no
- 87. Minkowski Sum Scary name…easy math A = { (1, 0), (0, 1), (0, −1)} B =
- 88. Reliable Queries In practice, we use the Minkowski sum of a bounding cube B and the
- 89. Reliable Queries Cubes only work for z-axis projections so in practice use a bounding sphere of
- 90. Bounding Offset So far we’ve just dealt with single triangles but we need whole objects This
- 91. Algorithm
- 92. Improvement over CULLIDE
- 93. Performance Still runs faster than CPU implementations 3x slower than CULLIDE due to bounding box rasterization
- 94. QCULLIDE Extends CULLIDE to handle self collisions in complex meshes All running in real time
- 95. Self Collision Culling Note that only intersecting triangles that don’t share a vertex or edge are
- 96. Self Collision Culling Algorithm Include all potentially colliding primitives and PCS where each primitive is a
- 97. Q-CULLIDE Sets BFV – Objects fully visible in both passes and are pruned from the PCS
- 98. Q-CULLIDE Properties of sets FFV and SFV are collision free No object in FFV collides with
- 99. Algorithm
- 100. Algorithm
- 101. What’s Happening
- 102. Improvement Over CULLIDE
- 103. Improvements Over CULLIDE Sends an order of magnitude less collisions to the CPU than CULLIDE
- 104. Spatial Subdivision Partition space into uniform grid Grid cell is at least as large as largest
- 105. Parallel Spatial Subdivision Complications: Single object can be involved in multiple collision tests Need to prevent
- 106. Guaranteed Individual Collision Tests Prove: No two cells updated in parallel may contain the same object
- 107. Example of Parallel Spatial Subdivision O1 O2 O3 O4 1 2 1 2 3 4 3
- 108. Avoiding Extra Collision Testing Associate each object a set of control bits to test where its
- 109. Implementing in CUDA Store list of object IDs, cell IDs in device memory Build the list
- 110. Initialization Cell ID Array OBJ 1 Cell ID 1 OBJ 1 Cell ID 2 OBJ 1
- 111. Construct the Cell ID Array Host Cells (H – Cells) Contain the centroid of the object
- 112. Sorting the Cell ID Array What we want: Sorted by Cell ID H cells of an
- 113. Sorting Cell Array 010 0 011 1 111 2 101 3 021 4 021 n 020
- 114. Spatial Subdivision 1 2 3 4 5 6 7 8 Images from pg 699, 700 GPU
- 115. Create the Collision Cell List Scan sorted cell ID array for changes of cell ID Mark
- 116. Create Collision Cell List 000 2 011 n 101 3 001 2 020 0 101 2
- 118. Скачать презентацию