Videoconferencing at Katholieke Universiteit Leuven Prof. Dr. Ir. Wim Van Petegem Erik Luyten.
Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip...
-
Upload
damon-harris -
Category
Documents
-
view
215 -
download
0
Transcript of Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip...
![Page 1: Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip Dutré Katholieke Universiteit Leuven.](https://reader036.fdocuments.in/reader036/viewer/2022062722/56649f335503460f94c4fc4e/html5/thumbnails/1.jpg)
Boolean Operations onBoolean Operations onSurfel-Bounded Solids Using Surfel-Bounded Solids Using
Programmable Graphics Programmable Graphics HardwareHardware
Bart Adams Philip Dutré
Katholieke Universiteit Leuven
![Page 2: Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip Dutré Katholieke Universiteit Leuven.](https://reader036.fdocuments.in/reader036/viewer/2022062722/56649f335503460f94c4fc4e/html5/thumbnails/2.jpg)
Goal: CSG on the GPUGoal: CSG on the GPU
not rendering, but construction
GPGPU
![Page 3: Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip Dutré Katholieke Universiteit Leuven.](https://reader036.fdocuments.in/reader036/viewer/2022062722/56649f335503460f94c4fc4e/html5/thumbnails/3.jpg)
Related WorkRelated Work
Adams and DutrAdams and Dutréé [2003] [2003] points, 3-color octreepoints, 3-color octree
Pauly et al.Pauly et al. [2003] [2003] points and MLS, kd-treepoints and MLS, kd-tree
Purcell et al.Purcell et al. [2002] [2002] ray tracing on the GPUray tracing on the GPU
Zwicker et al.Zwicker et al. [2004] [2004] splatting clipped surfelssplatting clipped surfels
![Page 4: Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip Dutré Katholieke Universiteit Leuven.](https://reader036.fdocuments.in/reader036/viewer/2022062722/56649f335503460f94c4fc4e/html5/thumbnails/4.jpg)
Adams and DutrAdams and Dutréé [2003] [2003]
• Space partitioned using 3-color octree
• Boundary cells partitioned using // planes
![Page 5: Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip Dutré Katholieke Universiteit Leuven.](https://reader036.fdocuments.in/reader036/viewer/2022062722/56649f335503460f94c4fc4e/html5/thumbnails/5.jpg)
Adams and DutrAdams and Dutréé [2003] [2003]
• Classification of a surfel:
test against 3-color octree
test against boundary planes
test against nearest surfel:
NN query!
α
![Page 6: Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip Dutré Katholieke Universiteit Leuven.](https://reader036.fdocuments.in/reader036/viewer/2022062722/56649f335503460f94c4fc4e/html5/thumbnails/6.jpg)
CPUCPU GPU: Problems 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
![Page 7: Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip Dutré Katholieke Universiteit Leuven.](https://reader036.fdocuments.in/reader036/viewer/2022062722/56649f335503460f94c4fc4e/html5/thumbnails/7.jpg)
Part 1: Inside-Outside Part 1: Inside-Outside PartitioningPartitioning
![Page 8: Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip Dutré Katholieke Universiteit Leuven.](https://reader036.fdocuments.in/reader036/viewer/2022062722/56649f335503460f94c4fc4e/html5/thumbnails/8.jpg)
Partitioning: IdeaPartitioning: Idea
• Partition space around solids
• Construct 3-color grid– interior cells– exterior cells– boundary cells
• Partition boundary cells– signed distance field
![Page 9: Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip Dutré Katholieke Universiteit Leuven.](https://reader036.fdocuments.in/reader036/viewer/2022062722/56649f335503460f94c4fc4e/html5/thumbnails/9.jpg)
Partitioning Boundary CellsPartitioning Boundary Cells
• Lay out cell corners in texture memory
p6
p7
p4
p5
p2
p3
p0
p1
p0 p1 p2
p7 p3
p6 p5 p4
![Page 10: Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip Dutré Katholieke Universiteit Leuven.](https://reader036.fdocuments.in/reader036/viewer/2022062722/56649f335503460f94c4fc4e/html5/thumbnails/10.jpg)
Partitioning Boundary CellsPartitioning Boundary Cells
• Lay out cell corners in texture memory
p4 p5 p6
p11 p7
p10 p9 p8
p6
p7
p4
p5
p10
p11
p8
p9
p2
p3
p0
p1
p0 p1 p2
p7 p3
p6 p5 p4
![Page 11: Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip Dutré Katholieke Universiteit Leuven.](https://reader036.fdocuments.in/reader036/viewer/2022062722/56649f335503460f94c4fc4e/html5/thumbnails/11.jpg)
Partitioning Boundary CellsPartitioning Boundary Cells
• Render each surfel as 3x3 glPoint with center corresponding to cell center
p4 p5 p6
p11 p7
p10 p9 p8
p6
p7
p4
p5
p10
p11
p8
p9
p2
p3
p0
p1
p0 p1 p2
p7 p3
p6 p5 p4
![Page 12: Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip Dutré Katholieke Universiteit Leuven.](https://reader036.fdocuments.in/reader036/viewer/2022062722/56649f335503460f94c4fc4e/html5/thumbnails/12.jpg)
Partitioning Boundary CellsPartitioning Boundary Cells
• Render each surfel as 3x3 glPoint with center corresponding to cell center
p4 p5 p6
p11 p7
p10 p9 p8
p6
p7
p4
p5
p10
p11
p8
p9
p2
p3
p0
p1
p0 p1 p2
p7 p3
p6 p5 p4
![Page 13: Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip Dutré Katholieke Universiteit Leuven.](https://reader036.fdocuments.in/reader036/viewer/2022062722/56649f335503460f94c4fc4e/html5/thumbnails/13.jpg)
Partitioning Boundary CellsPartitioning Boundary Cells
• Render each surfel as 3x3 glPoint with center corresponding to cell center
p4 p5 p6
p11 p7
p10 p9 p8
p6
p7
p4
p5
p10
p11
p8
p9
p2
p3
p0
p1
p0 p1 p2
p7 p3
p6 p5 p4
known as scatter easy in VP
![Page 14: Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip Dutré Katholieke Universiteit Leuven.](https://reader036.fdocuments.in/reader036/viewer/2022062722/56649f335503460f94c4fc4e/html5/thumbnails/14.jpg)
Partitioning Boundary CellsPartitioning Boundary Cells
• Fragment program computes signed distance between surfel and cell corner
p4 p5 p6
p11 p7
p10 p9 p8
p6
p7
p4
p5
p10
p11
p8
p9
p2
p3
p0
p1
p0 p1 p2
p7 p3
p6 p5 p4ps
dist = || p4 – ps ||
sign = (p4 – ps)·ns>0?+1:-1
color = dist * sign
depth = dist/diag
Set glDepthFunc to GL_LEQUAL
![Page 15: Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip Dutré Katholieke Universiteit Leuven.](https://reader036.fdocuments.in/reader036/viewer/2022062722/56649f335503460f94c4fc4e/html5/thumbnails/15.jpg)
• Construct 3-color grid using distance values from boundary cell corners– render textured quad– each pixel corresponds
to a cell
Classifying Empty CellsClassifying Empty Cells
![Page 16: Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip Dutré Katholieke Universiteit Leuven.](https://reader036.fdocuments.in/reader036/viewer/2022062722/56649f335503460f94c4fc4e/html5/thumbnails/16.jpg)
• 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
Classifying Empty CellsClassifying Empty Cells
![Page 17: Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip Dutré Katholieke Universiteit Leuven.](https://reader036.fdocuments.in/reader036/viewer/2022062722/56649f335503460f94c4fc4e/html5/thumbnails/17.jpg)
• Next passes: cells on the left from a classified empty cell are classified
• Easy in FP: – 1 texture fetch
Classifying Empty CellsClassifying Empty Cells
![Page 18: Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip Dutré Katholieke Universiteit Leuven.](https://reader036.fdocuments.in/reader036/viewer/2022062722/56649f335503460f94c4fc4e/html5/thumbnails/18.jpg)
• Next passes: cells on the left from a classified empty cell are classified
• Easy in FP: – 1 texture fetch
• Iterate further
Classifying Empty CellsClassifying Empty Cells
![Page 19: Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip Dutré Katholieke Universiteit Leuven.](https://reader036.fdocuments.in/reader036/viewer/2022062722/56649f335503460f94c4fc4e/html5/thumbnails/19.jpg)
• Next passes: cells on the left from a classified empty cell are classified
• Easy in FP: – 1 texture fetch
• Iterate further
Classifying Empty CellsClassifying Empty Cells
![Page 20: Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip Dutré Katholieke Universiteit Leuven.](https://reader036.fdocuments.in/reader036/viewer/2022062722/56649f335503460f94c4fc4e/html5/thumbnails/20.jpg)
• Next passes: cells on the left from a classified empty cell are classified
• Easy in FP: – 1 texture fetch
• Iterate further
Classifying Empty CellsClassifying Empty Cells
![Page 21: Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip Dutré Katholieke Universiteit Leuven.](https://reader036.fdocuments.in/reader036/viewer/2022062722/56649f335503460f94c4fc4e/html5/thumbnails/21.jpg)
• Next passes: cells on the left from a classified empty cell are classified
• Easy in FP: – 1 texture fetch
• Iterate further
Classifying Empty CellsClassifying Empty Cells
![Page 22: Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip Dutré Katholieke Universiteit Leuven.](https://reader036.fdocuments.in/reader036/viewer/2022062722/56649f335503460f94c4fc4e/html5/thumbnails/22.jpg)
• All non-classified cells are outside (assumption: closed solid)
Classifying Empty CellsClassifying Empty Cells
![Page 23: Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip Dutré Katholieke Universiteit Leuven.](https://reader036.fdocuments.in/reader036/viewer/2022062722/56649f335503460f94c4fc4e/html5/thumbnails/23.jpg)
Part 2: Inside-Outside Part 2: Inside-Outside ClassificationClassification
![Page 24: Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip Dutré Katholieke Universiteit Leuven.](https://reader036.fdocuments.in/reader036/viewer/2022062722/56649f335503460f94c4fc4e/html5/thumbnails/24.jpg)
Classification: IdeaClassification: Idea
• Test surfels against partitioning of other solid:
test against 3-color grid
test against distance field
(+ compute clipping plane)
![Page 25: Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip Dutré Katholieke Universiteit Leuven.](https://reader036.fdocuments.in/reader036/viewer/2022062722/56649f335503460f94c4fc4e/html5/thumbnails/25.jpg)
Implementation: First PassImplementation: 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
![Page 26: Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip Dutré Katholieke Universiteit Leuven.](https://reader036.fdocuments.in/reader036/viewer/2022062722/56649f335503460f94c4fc4e/html5/thumbnails/26.jpg)
Implementation: Second Implementation: Second PassPass
• 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!
![Page 27: Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip Dutré Katholieke Universiteit Leuven.](https://reader036.fdocuments.in/reader036/viewer/2022062722/56649f335503460f94c4fc4e/html5/thumbnails/27.jpg)
Clipping PlaneClipping Plane
• Surfels close to other surface:– clipped
– resampled
• Clipping plane defined by:– distance field value– distance field gradient
![Page 28: Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip Dutré Katholieke Universiteit Leuven.](https://reader036.fdocuments.in/reader036/viewer/2022062722/56649f335503460f94c4fc4e/html5/thumbnails/28.jpg)
Timings: partitioningTimings: partitioning
• Distance field creation step (~ #surfels)
# surfels 60k 170k 250k 370k
time 37ms 98ms 142ms 220ms
• 3-color grid creation step (~ grid size)
grid size 103 203 303 403
time 3ms 22ms 104ms 214ms
![Page 29: Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip Dutré Katholieke Universiteit Leuven.](https://reader036.fdocuments.in/reader036/viewer/2022062722/56649f335503460f94c4fc4e/html5/thumbnails/29.jpg)
Timings CPU Timings CPU GPU GPU
Partitioning Classification
[AD03] GPU [AD03] GPU
30k 60k 720ms 245ms 330ms 19ms
90k 170k 1980ms 351ms 490ms 49ms
200k 250k 3500ms 492ms 720ms 80ms
÷5 ÷10
![Page 30: Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip Dutré Katholieke Universiteit Leuven.](https://reader036.fdocuments.in/reader036/viewer/2022062722/56649f335503460f94c4fc4e/html5/thumbnails/30.jpg)
Dragon - dragonDragon - dragon
Each dragon:
#surfels:650k
grid size:363
partitioning:700ms
classification:122ms
![Page 31: Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip Dutré Katholieke Universiteit Leuven.](https://reader036.fdocuments.in/reader036/viewer/2022062722/56649f335503460f94c4fc4e/html5/thumbnails/31.jpg)
DiscussionDiscussion
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