+ All Categories
Home > Documents > Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip...

Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip...

Date post: 05-Jan-2016
Category:
Upload: damon-harris
View: 216 times
Download: 0 times
Share this document with a friend
Popular Tags:
31
Boolean Operations on Boolean Operations on Surfel-Bounded Solids Surfel-Bounded Solids Using Programmable Using Programmable Graphics Hardware Graphics Hardware Bart Adams Philip Dutré Katholieke Universiteit Leuven
Transcript
Page 1: Boolean Operations on Surfel-Bounded Solids Using Programmable Graphics Hardware Bart AdamsPhilip Dutré Katholieke Universiteit Leuven.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

• 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.

• 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.

• 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.

• 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.

• 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.

• 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.

• 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.

• 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.

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.

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.

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.

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.

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.

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.

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.

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.

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


Recommended