Title: Boolean Operations on SurfelBounded Solids Using Programmable Graphics Hardware
1Boolean Operations onSurfel-Bounded Solids Using
Programmable Graphics Hardware
- Bart Adams Philip Dutré
- Katholieke Universiteit Leuven
2Goal CSG on the GPU
not rendering, but construction ? GPGPU
3Related 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
4Adams and Dutré 2003
- Space partitioned using 3-color octree
- Boundary cells partitioned using // planes
5Adams and Dutré 2003
- Classification of a surfel
- test against 3-color octree
- test against boundary planes
- test against nearest surfel
- NN query!
a
6CPU? 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
7Part 1 Inside-Outside Partitioning
8Partitioning Idea
- Partition space around solids
- Construct 3-color grid
- interior cells
- exterior cells
- boundary cells
- Partition boundary cells
- signed distance field
9Partitioning Boundary Cells
- Lay out cell corners in texture memory
10Partitioning Boundary Cells
- Lay out cell corners in texture memory
11Partitioning Boundary Cells
- Render each surfel as 3x3 glPoint with center
corresponding to cell center
p10
p9
p11
p8
12Partitioning Boundary Cells
- Render each surfel as 3x3 glPoint with center
corresponding to cell center
p10
p9
p11
p8
13Partitioning Boundary Cells
- Render each surfel as 3x3 glPoint with center
corresponding to cell center
p10
p9
p11
p8
known as scatter easy in VP
14Partitioning Boundary Cells
- Fragment program computes signed distance between
surfel and cell corner
p6
p10
p5
p9
ps
p7
p11
dist p4 ps sign (p4
ps)nsgt0?1-1 color dist sign depth
dist/diag
p4
p8
Set glDepthFunc to GL_LEQUAL
15Classifying Empty Cells
- Construct 3-color grid using distance values from
boundary cell corners - render textured quad
- each pixel corresponds
- to a cell
16Classifying Empty Cells
- First pass cells on the left from boundary cell
are classified - inside if ?di lt 0
- outside if ?di gt 0
- Easy in FP
- 4 texture fetches
17Classifying Empty Cells
- Next passes cells on the left from a classified
empty cell are classified - Easy in FP
- 1 texture fetch
18Classifying Empty Cells
- Next passes cells on the left from a classified
empty cell are classified - Easy in FP
- 1 texture fetch
- Iterate further
19Classifying Empty Cells
- Next passes cells on the left from a classified
empty cell are classified - Easy in FP
- 1 texture fetch
- Iterate further
20Classifying Empty Cells
- Next passes cells on the left from a classified
empty cell are classified - Easy in FP
- 1 texture fetch
- Iterate further
21Classifying Empty Cells
- Next passes cells on the left from a classified
empty cell are classified - Easy in FP
- 1 texture fetch
- Iterate further
22Classifying Empty Cells
- All non-classified cells are outside (assumption
closed solid)
23Part 2 Inside-Outside Classification
24Classification Idea
- Test surfels against partitioning of other solid
- test against 3-color grid
- test against distance field
- ( compute clipping plane)
25Implementation 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 lt z2
26Implementation Second Pass
- Disable depth write
- Set glDepthFunc to GL_LEQUAL
- Render quad textured with surfel positions
- at depth z with z1 lt z lt z2
- Classify surfel using distance field
- 8 texture fetches, tri-linear reconstruction
- Only unclassified surfels pass
- fragments with z z2
- Early z culling!
27Clipping Plane
- Surfels close to other surface
- clipped
- resampled
- Clipping plane defined by
- distance field value
- distance field gradient
28Timings partitioning
- Distance field creation step ( surfels)
- 3-color grid creation step ( grid size)
29Timings CPU ? GPU
5
10
30Dragon - dragon
Each dragon surfels 650k grid
size 363 partitioning 700ms classification 12
2ms
31Discussion
- 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