Presentation is loading. Please wait.

Presentation is loading. Please wait.

Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip Dutré Katholieke Universiteit Leuven.

Similar presentations


Presentation on theme: "Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip Dutré Katholieke Universiteit Leuven."— Presentation transcript:

1 Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip 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 Partitioning Boundary Cells Lay out cell corners in texture memory p6p6 p7p7 p4p4 p5p5 p2p2 p3p3 p0p0 p1p1 p0p0 p1p1 p2p2 p7p7 p3p3 p6p6 p5p5 p4p4

10 Partitioning Boundary Cells Lay out cell corners in texture memory p4p4 p5p5 p6p6 p 11 p7p7 p 10 p9p9 p8p8 p6p6 p7p7 p4p4 p5p5 p 11 p8p8 p9p9 p2p2 p3p3 p0p0 p1p1 p0p0 p1p1 p2p2 p7p7 p3p3 p6p6 p5p5 p4p4

11 Partitioning Boundary Cells Render each surfel as 3x3 glPoint with center corresponding to cell center p4p4 p5p5 p6p6 p 11 p7p7 p 10 p9p9 p8p8 p6p6 p7p7 p4p4 p5p5 p 11 p8p8 p9p9 p2p2 p3p3 p0p0 p1p1 p0p0 p1p1 p2p2 p7p7 p3p3 p6p6 p5p5 p4p4

12 Partitioning Boundary Cells Render each surfel as 3x3 glPoint with center corresponding to cell center p4p4 p5p5 p6p6 p 11 p7p7 p 10 p9p9 p8p8 p6p6 p7p7 p4p4 p5p5 p 11 p8p8 p9p9 p2p2 p3p3 p0p0 p1p1 p0p0 p1p1 p2p2 p7p7 p3p3 p6p6 p5p5 p4p4

13 Partitioning Boundary Cells Render each surfel as 3x3 glPoint with center corresponding to cell center p4p4 p5p5 p6p6 p 11 p7p7 p 10 p9p9 p8p8 p6p6 p7p7 p4p4 p5p5 p 11 p8p8 p9p9 p2p2 p3p3 p0p0 p1p1 p0p0 p1p1 p2p2 p7p7 p3p3 p6p6 p5p5 p4p4 known as scatter easy in VP

14 Partitioning Boundary Cells Fragment program computes signed distance between surfel and cell corner p4p4 p5p5 p6p6 p 11 p7p7 p 10 p9p9 p8p8 p6p6 p7p7 p4p4 p5p5 p 11 p8p8 p9p9 p2p2 p3p3 p0p0 p1p1 p0p0 p1p1 p2p2 p7p7 p3p3 p6p6 p5p5 p4p4 psps dist = || p 4 – p s || sign = (p 4 – p s )·n s >0?+1:-1 color = dist * sign depth = dist/diag Set glDepthFunc to GL_LEQUAL

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

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

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

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

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

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

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

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

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 z 1 –if surfel in boundary cell: write depth value z 2 with z 1 < z 2

26 Implementation: Second Pass Disable depth write Set glDepthFunc to GL_LEQUAL Render quad textured with surfel positions –at depth z with z 1 < z < z 2 Classify surfel using distance field –8 texture fetches, tri-linear reconstruction Only unclassified surfels pass –fragments with z == z 2 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) # surfels60k170k250k370k time37ms98ms142ms220ms 3-color grid creation step (~ grid size) grid size10 3 20 3 30 3 40 3 time3ms22ms104ms214ms

29 Timings CPU  GPU PartitioningClassification [AD03]GPU[AD03]GPU 30k60k720ms245ms330ms19ms 90k170k1980ms351ms490ms49ms 200k250k3500ms492ms720ms80ms ÷5 ÷10

30 Dragon - dragon Each dragon: #surfels: 650k grid size: 36 3 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


Download ppt "Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip Dutré Katholieke Universiteit Leuven."

Similar presentations


Ads by Google