1 / 109

Geometric Computations on GPU: Proximity Queries

Geometric Computations on GPU: Proximity Queries. Avneesh Sud & Dinesh Manocha. This Lecture. Proximity Queries: Overview Visibility computations using GPUs Reliable GPU-based Computations Collision Detection Proximity Queries using Discrete Voronoi Diagram. Proximity Queries.

luyu
Download Presentation

Geometric Computations on GPU: Proximity Queries

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Geometric Computations on GPU: Proximity Queries Avneesh Sud & Dinesh Manocha

  2. This Lecture • Proximity Queries: Overview • Visibility computations using GPUs • Reliable GPU-based Computations • Collision Detection • Proximity Queries using Discrete Voronoi Diagram

  3. Proximity Queries Collision Detection Collision Detection

  4. Proximity Queries Penetration Depth Contact forces

  5. Proximity Queries Separation Distance Repulsive force, time of contact

  6. Motivation: Driving Applications • Computer animation • Surgical simulation • Robotics • Haptics • Bioinformatics

  7. Motivation • Interactive proximity computation among general deformable models Inter-object queries among multiple models

  8. Motivation • Interactive proximity computation among general deformable models Intra-object (self-proximity) queries in cloth simulation

  9. This Lecture • Proximity Queries: Overview • Visibility computations using GPUs • Reliable GPU-based Computations • Collision Detection • Proximity Queries using Discrete Voronoi Diagram

  10. Graphics Processing Units (GPUs) • Well-designed for visibility computations • Rasterization – image-space visibility • Massively parallel • Render millions of polygons per second • Well suited for image-based algorithms • High growth rate

  11. Recent growth rate of Graphics Processing Units Card Million triangles/sec Radeon 9700 Pro 325 GeForce FX 5800 350 Radeon 9800 XT 412 GeForce FX 5950 356 GeForce 6800 600 GeForce 7950 1000 GeForce 8800 ?

  12. GPUs: Geometric Computations • Used for geometric applications • Minkowski sums [Kim et al. 02] • CSG rendering [Goldfeather et al. 89, Rossignac et al. 90] • Voronoi computation [Hoff et al. 01, 02, Sud et al. 04] • Isosurface computation [Pascucci 04] • Map simplification [Mustafa et al. 01] • Collision Detection [Govindaraju03, Govindaraju04] • Proximity Computations [Sud06]

  13. Graphics Processing Units (GPUs) • Well-designed for visibility computations • Rasterization – image-space visibility • Massively parallel • Render millions of polygons per second • Well suited for image-based algorithms • High growth rate

  14. Stream of vertices Stream of visible pixels Vertex Processing Engines Pixel Processing Engines Setup of setup commands and state Stream of transformed vertices Alpha test Stencil test Depth test GPU GPU Draw stream of triangles CPU Visibility of triangles Setup Engine IEEE Floating Point (32-bit) IEEE Floating Point (32-bit) Limited Resolution!

  15. Stream of vertices Stream of visible pixels count of visible pixels Vertex Processing Engines Setup Engine Pixel Processing Engines Setup of setup commands and state Stream of transformed vertices Alpha test Stencil test Depth test GPU GPU Draw stream of triangles CPU Visibility of triangles

  16. GPUs for Geometric Computations: Issues • Precision • Frame-buffer readbacks

  17. Stream of visible pixels Pixel Processing Engines Frame-Buffer Precision Resolution along X, Y,Z X – 13 bits fixed precision Y – 13 bits fixed precision Z – 24 bits fixed precision* On CPU – 32-bit or 64-bit floating-point precision Limited Resolution!

  18. Frame-Buffer Readback • Involve stalls • Affect throughput • Slow!

  19. Frame-Buffer Readback Performance Data Courtesy: www.techreport.comJune 2004 Readback of 1Kx1K frame-buffer takes 18 ms over PCI-Express

  20. GPU Growth Rate CPU Growth Rate AGP Bandwidth Growth Rate Courtesy: Anselmo Lastra

  21. Solutions • Frame-Buffer Readbacks  Minimize readback data (eg Visibility information) • Precision  Refine answer on CPU

  22. NV Occlusion Query • Extension name: NV_occlusion_query • Returns pixel count – the no. of pixels that pass • Provides an interface to issue multiple queries at once before asking for the result of any one • Applications can now overlap the time it takes for the queries to return with other work increasing the parallelism between CPU and GPU

  23. NV Occlusion Query – How to Use (1) • (Optional) Disable Depth/Color Buffers • (Optional) Disable any other irrelevant non-geometric state • Generate occlusion queries • Begin ith occlusion query • Render ith (bounding) geometry • End occlusion query • Do other CPU computation while queries are being made • (Optional) Enable Depth/Color Buffers • (Optional) Re-enable other state • Get pixel count of ith query • If (count > MAX_COUNT) render ith geometry

  24. NV Occlusion Query – How to Use (2) • Generate occlusion queries Gluint queries[N]; GLuint pixelCount; glGenOcclusionQueriesNV(N, queries); • Loop over queries for (i = 0; i < N; i++) { glBeginOcclusionQueryNV(queries[i]); // render ith geometry glEndOcclusionQueryNV(); } • Get pixel counts for (i = 0; i < N; i++) { glGetOcclusionQueryuivNV(queries[i], GL_PIXEL_COUNT_NV, &pixelCount); if (pixelCount > MAX_COUNT) // do work for ith geometry }

  25. This Lecture • Proximity Queries: Overview • Visibility computations using GPUs • Reliable GPU-based Computations • Collision Detection • Proximity Queries using Discrete Voronoi Diagram

  26. GPU: Culling Coprocessor N-Objects AABB Culling GPU-Based Culling Exact Tests Potential Colliding Set 2.5D Overlap Tests Collision Potential Neighbor Set Distance Voronoi-Based Culling

  27. Inaccuracies in GPU-Based Algorithms • Image sampling • Depth buffer precision [Govindaraju, Lin, Manocha, Special Issue on Best Papers of ACM VRST’04 in IEEE TVCG]

  28. Image Sampling • Occurs when a primitive does not cover any pixels

  29. Image Sampling • Primitives are rasterized but no intersecting points are sampled by hardware Intersecting point C = pixel center Viewport

  30. Depth Buffer Precision • Intersecting points are sampled but precision is not sufficient Intersecting point T1 C = pixel center Viewport

  31. Overcome Image Sampling • Sufficiently fatten the triangles • Use Minkowski sums Minkowski Sum AB = A B = {a + b: a A, b B}

  32. PL Minkowski Sum: Example L P

  33. This Lecture • Proximity Queries: Overview • Visibility computations using GPUs • Reliable GPU-based Computations • Collision Detection • Proximity Queries using Discrete Voronoi Diagram

  34. Goal Interactive collision detectionbetween complex objects • Large number of objects • High primitive count • Non-convex objects • Open and closed objects

  35. Non-rigid Motion • Deformable objects • Changing topology • Self-collisions

  36. CULLIDE: Overview • Potentially Colliding Set (PCS) computation • Exact collision tests on the PCS[Govindaraju, Redon, Lin, Manocha, ACM Graphics Hardware 2003]

  37. GPU-based PCS computation Using CPU Algorithm Object-LevelPruning Subobject-LevelPruning Exact Tests

  38. PCS Potentially Colliding Set (PCS)

  39. Potentially Colliding Set (PCS) PCS

  40. Algorithm Object-LevelPruning Subobject- LevelPruning Exact Tests

  41. View O Visibility of Objects • An object is fully visible if it is completely in front of the remaining objects O1 O2

  42. View O Visibility for Collisions: Geometric Interpretation Sufficient but not a necessary condition for existence of separating surface with unit depth complexity O1 O2

  43. PCS Pruning • Prune objects that do not collide

  44. PCS Pruning O1 O2 … Oi-1 Oi Oi+1 … On-1 On O1 O2 … Oi-1OiOi+1 … On-1 On O1 O2 … Oi-1 Oi Oi+1 … On-1 On

  45. PCS Computation • Each object tested against all objects but itself • Naive algorithm is O(n2) • Linear time algorithm • Uses two pass rendering approach • Conservative solution

  46. Render PCS Computation: First Pass O1 O2 … Oi-1 Oi Oi+1 … On-1 On

  47. Render Yes. Does not collide withO1,O2,…,Oi-1 Fully Visible? PCS Computation: First Pass O1 O2 … Oi-1Oi

  48. Render Fully Visible? PCS Computation: First Pass O1 O2 … Oi-1 Oi Oi+1 … On-1On

  49. Render PCS Computation: Second Pass O1 O2 … Oi-1 Oi Oi+1 … On-1 On

  50. Render Yes. Does not collide with Oi+1,…,On-1,On Fully Visible? PCS Computation: Second Pass OiOi+1 … On-1 On

More Related