109
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Geometric Computations on GPU: Proximity Queries Avneesh Sud & Dinesh Manocha

Geometric Computations on GPU: Proximity Queries

  • Upload
    luyu

  • View
    66

  • Download
    1

Embed Size (px)

DESCRIPTION

Geometric Computations on GPU: Proximity Queries. Avneesh Sud &Dinesh Manocha. This Lecture. Proximity Queries: Overview Visibility computations using GPUs Reliable GPU-based Computations Collision Detection Proximity Queries using Discrete Voronoi Diagram. Proximity Queries. - PowerPoint PPT Presentation

Citation preview

Page 1: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Geometric Computations on GPU: Proximity Queries

Avneesh Sud & Dinesh Manocha

Page 2: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

This LectureProximity Queries: OverviewVisibility computations using GPUsReliable GPU-based ComputationsCollision DetectionProximity Queries using Discrete Voronoi Diagram

Page 3: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Proximity QueriesCollision Detection

Collision Detection

Page 4: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Proximity QueriesPenetration Depth Contact

forces

Page 5: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Proximity QueriesSeparation Distance

Repulsive force, time of contact

Page 6: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Motivation: Driving Applications

Computer animationSurgical simulationRoboticsHapticsBioinformatics

Page 7: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

MotivationInteractive proximity computation among general deformable models

Inter-object queries among multiple models

Page 8: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

MotivationInteractive proximity computation among general deformable models

Intra-object (self-proximity) queries in cloth simulation

Page 9: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

This LectureProximity Queries: OverviewVisibility computations using GPUsReliable GPU-based ComputationsCollision DetectionProximity Queries using Discrete Voronoi Diagram

Page 10: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Graphics Processing Units (GPUs)

Well-designed for visibility computations

Rasterization – image-space visibilityMassively parallel

Render millions of polygons per secondWell suited for image-based algorithms

High growth rate

Page 11: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Recent growth rate of Graphics Processing Units

Card Million triangles/secRadeon 9700 Pro 325GeForce FX 5800 350Radeon 9800 XT 412GeForce FX 5950 356GeForce 6800 600GeForce 7950 1000GeForce 8800 ?

Page 12: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

GPUs: Geometric Computations

Used for geometric applicationsMinkowski sums [Kim et al. 02]CSG rendering [Goldfeather et al. 89, Rossignac et al. 90]Voronoi computation [Hoff et al. 01, 02, Sud et al. 04]Isosurface computation [Pascucci 04]Map simplification [Mustafa et al. 01]Collision Detection [Govindaraju03, Govindaraju04]Proximity Computations [Sud06]

Page 13: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Graphics Processing Units (GPUs)

Well-designed for visibility computations

Rasterization – image-space visibilityMassively parallel

Render millions of polygons per secondWell suited for image-based algorithms

High growth rate

Page 14: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Setup EngineStream of transformed vertices

Setup of setup commands and state

Vertex Processing Engines

Pixel Processing Engines

Stream of visible pixels

Alpha test

Stencil test

Depth test

Stream of vertices

IEEE Floating Point (32-bit)

IEEE Floating Point (32-bit) Limited Resolution!

Draw stream of triangles CPUGPU

Visibility of triangles

GPU

Page 15: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Draw stream of triangles CPUGPU

Visibility of triangles

Vertex Processing Engines Setup Engine

Stream of vertices

Stream of visible pixels

Alpha test

Pixel Processing Engines

Stencil test

Depth test

Stream of transformed vertices

Setup of setup commands and state

count of visible pixels

GPU

Page 16: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

GPUs for Geometric Computations: Issues

PrecisionFrame-buffer readbacks

Page 17: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Pixel Processing Engines

Stream of visible pixels

Limited Resolution!

Resolution along X, Y,Z

X – 13 bits fixed precision

Y – 13 bits fixed precision

Z – 24 bits fixed precision*

On CPU – 32-bit or 64-bit floating-point precision

Frame-Buffer Precision

Page 18: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Frame-Buffer ReadbackInvolve stalls

Affect throughputSlow!

Page 19: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Frame-Buffer Readback Performance

Data Courtesy: www.techreport.comJune 2004

Readback of 1Kx1K frame-buffer takes 18 ms over PCI-Express

Page 20: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

GPU Growth Rate

CPU Growth Rate

AGP Bandwidth Growth Rate

Courtesy: Anselmo Lastra

Page 21: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

SolutionsFrame-Buffer Readbacks Minimize readback data (eg Visibility information)Precision Refine answer on CPU

Page 22: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

NV Occlusion QueryExtension name: NV_occlusion_queryReturns pixel count – the no. of pixels that passProvides an interface to issue multiple queries at once before asking for the result of any oneApplications can now overlap the time it takes for the queries to return with other work increasing the parallelism between CPU and GPU

Page 23: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

NV Occlusion Query – How to Use (1)(Optional) Disable Depth/Color Buffers(Optional) Disable any other irrelevant non-geometric stateGenerate occlusion queriesBegin ith occlusion queryRender ith (bounding) geometryEnd occlusion queryDo other CPU computation while queries are being made(Optional) Enable Depth/Color Buffers(Optional) Re-enable other stateGet pixel count of ith queryIf (count > MAX_COUNT) render ith geometry

Page 24: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

NV Occlusion Query – How to Use (2)Generate occlusion queriesGluint queries[N];GLuint pixelCount;glGenOcclusionQueriesNV(N, queries);Loop over queriesfor (i = 0; i < N; i++) {

glBeginOcclusionQueryNV(queries[i]); // render ith geometry glEndOcclusionQueryNV(); }

Get pixel countsfor (i = 0; i < N; i++) {

glGetOcclusionQueryuivNV(queries[i], GL_PIXEL_COUNT_NV, &pixelCount); if (pixelCount > MAX_COUNT) // do work for ith geometry }

Page 25: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

This LectureProximity Queries: OverviewVisibility computations using GPUsReliable GPU-based ComputationsCollision DetectionProximity Queries using Discrete Voronoi Diagram

Page 26: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

GPU: Culling Coprocessor

AABB Culling

Exact Tests2.5D Overlap

Tests

Voronoi-Based Culling

Collision

Distance Potential Neighbor Set

N-ObjectsGPU-Based Culling

Potential Colliding Set

Page 27: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Inaccuracies in GPU-Based Algorithms

Image samplingDepth buffer precision

[Govindaraju, Lin, Manocha,Special Issue on Best Papers of ACM

VRST’04in IEEE TVCG]

Page 28: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Image SamplingOccurs when a primitive does not cover any pixels

Page 29: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Image SamplingPrimitives are rasterized but no intersecting points are sampled by hardware

Viewport

C = pixel center

Intersecting point

Page 30: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Depth Buffer PrecisionIntersecting points are sampled but precision is not sufficient

Viewport

C = pixel center

Intersecting point

T1

Page 31: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Overcome Image Sampling

Sufficiently fatten the trianglesUse Minkowski sums

Minkowski Sum AB = A B = {a + b: a A, b

B}

Page 32: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

PL

Minkowski Sum: Example

P L

Page 33: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

This LectureProximity Queries: OverviewVisibility computations using GPUsReliable GPU-based ComputationsCollision DetectionProximity Queries using Discrete Voronoi Diagram

Page 34: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Goal Interactive collision detection

between complex objectsLarge number of objectsHigh primitive countNon-convex objectsOpen and closed objects

Page 35: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Non-rigid MotionDeformable objectsChanging topologySelf-collisions

Page 36: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

CULLIDE: Overview

Potentially Colliding Set (PCS) computationExact collision tests on the PCS

[Govindaraju, Redon, Lin, Manocha, ACM Graphics Hardware 2003]

Page 37: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Algorithm

Object-LevelPruning

Subobject-Level

PruningExact Tests

GPU-based PCS computation Using CPU

Page 38: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Potentially Colliding Set (PCS)

PCS

Page 39: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Potentially Colliding Set (PCS)

PCS

Page 40: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Algorithm

Object-LevelPruning

Subobject- Level

PruningExact Tests

Page 41: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Visibility of ObjectsAn object is fully visible if it is completely in front of the remaining objects

O1

O

View

O2

Page 42: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Visibility for Collisions: Geometric Interpretation

Sufficient but not a necessary condition for existence of separating surface with unit depth complexity

O1

O

View

O2

Page 43: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

PCS Pruning

Prune objects that do not collide

Page 44: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

PCS Pruning

O1 O2 … Oi-1 Oi Oi+1 … On-1 OnO1 O2 … Oi-1 Oi Oi+1 … On-1 OnO1 O2 … Oi-1 Oi Oi+1 … On-1 On

Page 45: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

PCS ComputationEach object tested against all objects but itselfNaive algorithm is O(n2)Linear time algorithm

Uses two pass rendering approachConservative solution

Page 46: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

PCS Computation: First Pass

O1 O2 … Oi-1 Oi Oi+1 … On-1 On

Render

Page 47: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

O1 O2 … Oi-1 Oi

PCS Computation: First Pass

Fully Visible?

Render Yes. Does not collide withO1,O2,…,Oi-1

Page 48: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

PCS Computation: First Pass

O1 O2 … Oi-1 Oi Oi+1 … On-1 On

Render

Fully Visible?

Page 49: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

PCS Computation: Second Pass

O1 O2 … Oi-1 Oi Oi+1 … On-1 On

Render

Page 50: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

PCS Computation: Second Pass

Render

Fully Visible?

Oi Oi+1 … On-1 On

Yes. Does not collide with Oi+1,…,On-1,On

Page 51: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

PCS Computation: Second Pass

Render

Fully Visible?

O1 O2 … Oi-1 Oi Oi+1 … On-1 On

Page 52: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

PCS Computation

O1 O2 … Oi-1 Oi Oi+1 … On-1 On

Fully VisibleFully Visible

Page 53: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

PCS Computation

O1 O2 O3 … Oi-1 Oi Oi+1 … On-2 On-1 On

O1 O3 … Oi-1 Oi+1 … On-1

Page 54: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Algorithm

Object-LevelPruning

Subobject- Level

PruningExact Tests

Page 55: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

CULLIDE Algorithm

Object-LevelPruning

Subobject-Level

PruningExact Tests

Exact overlap tests using CPU

Page 56: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Full Visibility Queries on GPUs

We require a queryTests if a primitive is fully visible or not

Current hardware supports occlusion queries

Test if only part of a primitive is visible or not

Our solutionChange the sign of the depth function

Page 57: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Full Visibility Queries on GPUs

Depth functionGEQUAL LESS

All fragments Pass FailPassFail

FailPassFail PassFail

Query not supported

Occlusion query

Examples - HP_Occlusion_test, NV_occlusion_query

Page 58: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Bandwidth AnalysisRead back only integer identifiers

Computation at high screen resolutions

Page 59: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Demo: CULLIDE

Page 60: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Quick-CULLIDE

Improved two-pass algorithmUtilize visibility relationships among objects across different viewsHandle intra-object collisions

[Govindaraju, Lin, Manocha,IEEE Virtual Reality 2005]

Page 61: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Quick-CULLIDE: Visibility Sets

Decompose PCS into four disjoint sets

FFV (First pass Fully Visible)SFV (Second pass Fully Visible)NFV (Not Fully Visible in either passes)BFV (Both passes Fully Visible)

Visibility sets have five interesting properties!

Page 62: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Visibility Sets: Properties

FFV and SFV are collision-free sets

Page 63: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

PCS Computation: First Pass

O1 O2 … Oi-1 Oi … Oj … On-1 On

Render

Page 64: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

PCS Computation: First Pass

O1 O2 … Oi-1 Oi … Oj … On-1 On

Render

Fully Visible

Page 65: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Visibility Sets: PropertiesIt is sufficient to test visibility of

objects in FFV in second pass only

Page 66: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

PCS Computation: First Pass

O1 O2 … Oi-1 Oi Oi+1 … On-1 On

Page 67: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

O1 O2 … Oi-1 Oi

PCS Computation: First Pass

Render

Page 68: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

PCS Computation: First Pass

O1 O2 … Oi-1 Oi Oi+1 … On-1 OnNot Colliding

Collision tested in Second pass

Page 69: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Visibility Sets: PropertiesIt is sufficient to render objects in

FFV in first pass only!

Page 70: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

PCS Computation: First Pass

O1 O2 … Oi-1 Oi Oi+1 … On-1 On

Page 71: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

O1 O2 … Oi-1 Oi

PCS Computation: First Pass

Render

Page 72: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

PCS Computation

O1 O2 … Oi-1 Oi Oi+1 … On-1 OnNot Colliding

Render

Page 73: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Visibility Sets: PropertiesIt is sufficient to test the visibility

of objects in SFV in first pass only!

Page 74: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Visibility Sets: Properties

It is sufficient to render objects in SFV in second pass only!

Page 75: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Quick-CULLIDE: Advantages

Better culling efficiency Lower depth complexity than CULLIDEAlways better than CULLIDE

Faster computational performanceLower number of visibility queries and rendering operations

Can handle self-collisions

Page 76: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Demo: Quick-CULLIDE

Page 77: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Reliability

z

x

Given a primitive P

P

Page 78: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Reliability

z

x

Px is the portion of P projecting inside pixel X

Pixel X

Px

Page 79: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

S

Reliability

z

x

S is a sphere centered at origin bounding pixel X

Pixel X

Px

Page 80: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Reliability

z

x

If we compute Minkowski sum PxS= Px S,

Pixel X

PxS

Px

Page 81: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Reliability

z

x

Px

then the rasterization of the Minkowski sum PxS

generates two fragments

Pixel X

PxS

Sample Depths

Page 82: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Reliability

z

x

Px

and the fragments bound depth values in Px

Pixel X

PxS

Sample Depths

Page 83: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Reliability

z

x

P1

Given two primitives P1 and P2

Pixel X

P2

Page 84: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Reliability

d

x

P1

If P1 and P2 intersect in 3-D,

Pixel X

P2

P1 and P2 intersect in 3-D

Page 85: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Reliability

d

x

P1

and we compute their Minkowski sums with a pixel-sized sphere centered at origin

Pixel X

P2

Page 86: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Reliability

z

x

P1

rasterization of the Minkowski sums overlap in image-space

Pixel X

P2

Page 87: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

z

x

Pixel X

P1

P2

P1S

P2S

Page 88: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Bounding Offsets of a Triangle

Exact OffsetsThree edge-aligned cylinders, three spheres, two trianglesCan be rendered using fragment programsExpensive!

Oriented Bounding Box (OBB)

Page 89: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Union of OBBs

Page 90: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Demo: R-CULLIDE

Page 91: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

This LectureProximity Queries: OverviewVisibility computations using GPUsReliable GPU-based ComputationsCollision DetectionProximity Queries using Discrete Voronoi Diagram

Page 92: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

N-Body Distance QueryGiven a set of sites, find all closest pairsNearest-neighbor for each site1 5

2 1

3 1

4 1

5 1

6 5

1

2

3

4

5

6

Page 93: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

GoalCompute N-Body distance efficiently

CullingFor each site, compute Potential Neighbor Set (PNS) of sites

1

2

3

4

5

6

1 5

Page 94: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

GoalCompute N-Body distance efficientlyFor each site, compute Potential Neighbor Set (PNS) of sites

Contains nearest neighbor

1

2

3

4

5

6

PNS(1) = {5,3}

Page 95: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

OutlineRelated workN-Body distance queriesCulling using second order discrete Voronoi diagramsResults

Page 96: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Voronoi Culling for N-Body Query

AABB Culling

Voronoi-based Culling

N-ObjectsStage I Stage II

Exact Distance Tests

Potential Neighbor Set

Stage III

Page 97: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Second-order Voronoi Diagram

1

2

3

4

5

6

Governors = 2 closest sites

Page 98: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Benefit of Second-order Voronoi Diagram

Voronoi diagram: Spatial partition based on proximitySecond-order Voronoi diagram: Proximity to two sites

Nearest neighbor information

Page 99: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Culling using Second-order Voronoi Diagram

12 3

9

9 Polygonal Objects

Page 100: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Culling using Second-order Voronoi Diagram

PNS(1) = Sites whose second order Voronoi regions intersect 1

12 3

9

Second order Voronoi Diagram

8 7

4 56

Page 101: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Culling using Second-order Voronoi Diagram

PNS(1) = Sites whose second order Voronoi regions intersect 1

PNS(1) = {2,3}Second order Voronoi diagram provides PNS for all sites

12 3

PNS(1)

Page 102: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Culling using Second-order Voronoi Diagram

PNS(1) = Sites whose second order Voronoi regions intersect 1Second order Voronoi diagram provides PNS for all sitesPNS(1) = {2,3}PNS(2) = {1,4,9}

12

PNS(2)

9

4

Page 103: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Culling using Second-order Voronoi Diagram

PNS(1) = Sites whose second order Voronoi regions intersect 1Second order Voronoi diagram provides PNS for all sitesPNS(1) = {2,3}PNS(2) = {1,4,9}…PNS(9) = {2,8}

2

PNS(9)

9 8

Page 104: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Proximity Culling using Discrete Voronoi Diagram

Computing exact Voronoi diagram difficult

Page 105: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Proximity Culling using Discrete Voronoi Diagram

Computing exact Voronoi diagram difficultCompute Discrete Voronoi Diagram (DVD)

Interactive computation using GPU

Second order details in thesis

Discrete Voronoi Diagram

Page 106: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Distance Bounds for Conservative Computation

Under-sampling errorsProvides approximate separation distance (SD)

SD’SD

Page 107: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Distance Bounds for Conservative Computation

Theorem (Distance bounds):

SD’

Page 108: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Distance Bounds for Conservative ComputationTheorem (Distance bounds):

SD’ - < SD < SD’ +

SD’ = Approximate Separation DistanceSD = Exact Separation Distance = Grid resolution

SD

Page 109: Geometric Computations on GPU: Proximity Queries

The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL

Distance Bounds for Conservative Computation

Compute PNS using distance boundsExact tests on CPU