1 / 31

Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware

Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware. Bart Adams Philip Dutr é Katholieke Universiteit Leuven. Goal: CSG on the GPU. not rendering, but construction  GPGPU. Related Work. Adams and Dutr é [2003] points, 3-color octree. Pauly et al. [2003]

esanabria
Download Presentation

Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware

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. Boolean Operations onSurfel-Bounded Solids Using Programmable Graphics Hardware Bart Adams Philip Dutré Katholieke Universiteit Leuven

  2. Goal: CSG on the GPU not rendering, but construction  GPGPU

  3. Related Work Adams and Dutré [2003] • points, 3-color octree Pauly et al. [2003] • points and MLS, kd-tree Purcell et al. [2002] • ray tracing on the GPU Zwicker et al. [2004] • splatting clipped surfels

  4. Adams and Dutré [2003] • Space partitioned using 3-color octree • Boundary cells partitioned using // planes

  5. Adams and Dutré [2003] • Classification of a surfel: test against 3-color octree test against boundary planes test against nearest surfel: NN query! α

  6. CPU GPU: Problems • Hierarchical algorithm • solution: • use 3-color grid instead of octree • only test surfels individually • NN query for surfels close to the boundary • solution: • avoid NN query • use local distance fields

  7. Part 1: Inside-Outside Partitioning

  8. Partitioning: Idea • Partition space around solids • Construct 3-color grid • interior cells • exterior cells • boundary cells • Partition boundary cells • signed distance field

  9. p6 p0 p7 p5 p1 p4 p3 p2 p2 p6 p1 p5 p3 p7 p0 p4 Partitioning Boundary Cells • Lay out cell corners in texture memory

  10. p6 p4 p7 p0 p5 p1 p5 p4 p6 p3 p2 p2 p10 p6 p11 p7 p1 p9 p5 p10 p9 p8 p11 p3 p7 p0 p8 p4 Partitioning Boundary Cells • Lay out cell corners in texture memory

  11. p6 p4 p7 p0 p1 p5 p5 p2 p3 p4 p6 p2 p6 p11 p7 p1 p5 p10 p9 p8 p3 p7 p0 p4 Partitioning Boundary Cells • Render each surfel as 3x3 glPoint with center corresponding to cell center p10 p9 p11 p8

  12. p6 p4 p7 p0 p1 p5 p5 p2 p3 p4 p6 p2 p6 p11 p7 p1 p5 p10 p9 p8 p3 p7 p0 p4 Partitioning Boundary Cells • Render each surfel as 3x3 glPoint with center corresponding to cell center p10 p9 p11 p8

  13. p6 p7 p4 p0 p5 p1 p5 p6 p2 p3 p4 p2 p6 p11 p7 p1 p5 p10 p9 p8 p3 p7 p0 p4 Partitioning Boundary Cells • Render each surfel as 3x3 glPoint with center corresponding to cell center p10 p9 p11 p8 known as scatter easy in VP

  14. p6 p4 p0 p7 p5 p5 p1 p4 p6 p3 p2 p2 p11 p7 p1 p10 p9 p8 p3 p0 Partitioning Boundary Cells • Fragment program computes signed distance between surfel and cell corner p10 p6 p9 p5 ps p11 p7 dist = || p4 – ps || sign = (p4 – ps)·ns>0?+1:-1 color = dist * sign depth = dist/diag p8 p4 Set glDepthFunc to GL_LEQUAL

  15. Classifying Empty Cells • Construct 3-color grid using distance values from boundary cell corners • render textured quad • each pixel corresponds to a cell

  16. Classifying Empty Cells • First pass: cells on the left from boundary cell are classified • inside if di < 0 • outside if di > 0 • Easy in FP: • 4 texture fetches

  17. Classifying Empty Cells • Next passes: cells on the left from a classified empty cell are classified • Easy in FP: • 1 texture fetch

  18. Classifying Empty Cells • Next passes: cells on the left from a classified empty cell are classified • Easy in FP: • 1 texture fetch • Iterate further

  19. Classifying Empty Cells • Next passes: cells on the left from a classified empty cell are classified • Easy in FP: • 1 texture fetch • Iterate further

  20. Classifying Empty Cells • Next passes: cells on the left from a classified empty cell are classified • Easy in FP: • 1 texture fetch • Iterate further

  21. Classifying Empty Cells • Next passes: cells on the left from a classified empty cell are classified • Easy in FP: • 1 texture fetch • Iterate further

  22. Classifying Empty Cells • All non-classified cells are outside (assumption: closed solid)

  23. Part 2: Inside-Outside Classification

  24. Classification: Idea • Test surfels against partitioning of other solid: test against 3-color grid test against distance field (+ compute clipping plane)

  25. Implementation: First Pass • Enable depth write • Render quad textured with surfel positions • Test each surfel against 3-color grid • if surfel in empty cell: • surfel takes classification of empty cell • write depth value z1 • if surfel in boundary cell: • write depth value z2 with z1 <z2

  26. Implementation: Second Pass • Disable depth write • Set glDepthFunc to GL_LEQUAL • Render quad textured with surfel positions • at depth z with z1 < z < z2 • Classify surfel using distance field • 8 texture fetches, tri-linear reconstruction • Only unclassified surfels pass • fragments with z == z2 • Early z culling!

  27. Clipping Plane • Surfels close to other surface: • clipped • resampled • Clipping plane defined by: • distance field value • distance field gradient

  28. Timings: partitioning • Distance field creation step (~ #surfels) • 3-color grid creation step (~ grid size)

  29. Timings CPU  GPU ÷10 ÷5

  30. Dragon - dragon Each dragon: #surfels: 650k grid size: 363 partitioning: 700ms classification: 122ms

  31. Discussion Limitations • space wasted in distance field texture • not adaptive ( ADFs) • no hierarchy: each surfel classified individually • accuracy dependent on grid resolution Advantages • 5 to 10 times faster

More Related