61
Fast Geometric Computations using GPUs 김영준 http://graphics.ewha.ac.kr 이화여자대학교 컴퓨터학과

Fast Geometric Computations using GPUs - Nvidiakr.nvidia.com/content/cudazone/download/showcase/kr/Ehwa-univ... · Fast Geometric Computations using GPUs ... Pre-computed AABB-trees

  • Upload
    vothuan

  • View
    222

  • Download
    1

Embed Size (px)

Citation preview

Fast Geometric Computations using GPUs

김영준http://graphics.ewha.ac.kr

이화여자대학교

컴퓨터학과

TopicsCollision detection

Closest point query

Approximate arrangement computation

Ewha Womans University http://graphics.ewha.ac.kr 2

Streaming AABBsCollision detection for deformable models

Ewha Womans University http://graphics.ewha.ac.kr 3

Teaser Video

Ewha Womans University http://graphics.ewha.ac.kr 4

Ewha Womans University http://graphics.ewha.ac.kr 5

Streaming AABB Pipeline1. Stream setup2. Stream calculation3. Stream update

Ewha Womans University http://graphics.ewha.ac.kr 6

Streaming AABBs

(a) Intersecting bunny models (b) Pre-computed AABB-trees (c) Intersecting AABB streams

Pull Down

Stream setup using pre-computed AABB trees

Ewha Womans University http://graphics.ewha.ac.kr 7

Streaming AABBs

Vertex textures

MAX

MINAABB Streams

Ewha Womans University http://graphics.ewha.ac.kr 8

Streaming AABB Overlap TestStreaming AABBs of model B

Ewha Womans University http://graphics.ewha.ac.kr 9

Streaming CD ResultsCollision result of AABB pairs stored at an off-screen buffer

Intersected models

Ewha Womans University http://graphics.ewha.ac.kr 10

Readback from GPU to CPUReadback from GPU to CPU is costly

50 milli-seconds for 1024x1024 frame buffer

Hierarchical readback

Ewha Womans University http://graphics.ewha.ac.kr 11

Stream Reduction

Level 0

Level 1

Level n

Ewha Womans University http://graphics.ewha.ac.kr 12

Readback

Level 3 (P3)Level 2 (P2)

Level 1 (P1)

Level 0 (P0)Encoding

Ewha Womans University http://graphics.ewha.ac.kr 13

ReadbackDecoding

Level 3 (P3)Level 2 (P2)

Level 1 (P1)

Level 0 (P0)

Time (encoding) + Time (decoding) << Time (direct readback) Video

Ewha Womans University http://graphics.ewha.ac.kr 14

Primitive Level TestTriangle-triangle overlap test using CPUs

Ewha Womans University http://graphics.ewha.ac.kr 15

Stream UpdateVertex textures

MAX

MIN

Framebuffer-1

Framebuffer-2Multi-Rendering Targets (MRT)

Fragment programFragment shader

Ewha Womans University http://graphics.ewha.ac.kr 16

ImplemetationStreaming computation in GPUs

nVIDIA GeForce 7800 GTX GPU (PCI-E)512 MB video memory32-bit floating point

Serial computation in CPU3.4 GHz Intel Dual Core Processor,2.7 GB main memory

LanguangeC++ in WindowsnVIDIA’s Cg (vp40 and fp40 profiles)OpenGL 2.0

Ewha Womans University http://graphics.ewha.ac.kr 17

Benchmarking Scenarios

(a) Interlocking torii(15000x2 triangles, 60-80 FPS)

(b) Touching torii(15000x2 triangles, 90-100 FPS)

(c) Merging torii(15000x2 triangles, 25-30 FPS)

(d) Bump bunnies(15000x2 triangles, 50-60 FPS)

(e) Happy buddhas(20000x2 triangles, 25-40 FPS)

(f) Intimate animals(50000x2 triangles, 20-30 FPS)

Ewha Womans University http://graphics.ewha.ac.kr 18

Performance ComparisonThree times performance improvement over CULLIDENo collision misses up to floating point precision

Demo Video

Ewha Womans University http://graphics.ewha.ac.kr 19

Parallel Triangle Intersection Test Using CUDA

Triangles of Object1

(n1)

Triangles of Object2 (n2)

b_hig

b_wid

(tri1, tri2)

ImplementationEnvironment

Microsoft Visual Studio 2005CUDA Toolkit/SDK 1.1OpenGL LibraryIntel Core2Duo E6550nVIDIA GeForce 8800 GTX

BenchmarksModel 1 Model 2

Scenario 1 Sphere(960) Cylinder(216)Scenario 2 Cup(7580) Azucar(5250)Scenario 3 Cup(7580) Spoon(26012)

Intersection ResultsSphere & Cylinder

CPU vs. GPU(CUDA)

Ewha Womans University

Time (ms)CPU 11.84

GPU(CUDA) 2.34

5 times faster!

Intersection ResultsCup & Azucar

CPU vs. GPU(CUDA)

Ewha Womans University

Time (ms)CPU 2099.5

GPU(CUDA) 183.9

11 times faster!

Intersection ResultsCup & Spoon

CPU vs. GPU(CUDA)

Ewha Womans University

Time (ms)CPU 10377.62

GPU(CUDA) 1084.22

10 times faster!

Closest Point QueryApplication to penetration depth computation

Ewha Womans University http://graphics.ewha.ac.kr 25

Ewha Womans University Young J. Kim 26

Closest Point QueryShortest distance from a point to the surface of the union of convex polytopesApproximate the query using GPUs

difficult

easy

Ewha Womans University Young J. Kim 27

Main IdeaIncrementally expand the current front of the boundary

Closet Point Query

Ewha Womans University Young J. Kim 28

Closest Point Query1. Render front faces, and open up a window where z-

value is less than the current front2. Render back faces w/ z-greater-than test3. Repeat the above m times, where m := # of obj’s

Ewha Womans University Young J. Kim 29

Closest Point Query1. Render front faces, and open up a window where z-

value is less than the current front2. Render back faces w/ z-greater-than test3. Repeat the above m times, where m := # of obj’s

Ewha Womans University Young J. Kim 30

Penetration Depth (PD)

Minimum translational distance needed to separate objects

Ewha Womans University Young J. Kim 31

Penetration Depth (PD)

d

Minimum translational distance needed to separate objects

Ewha Womans University Young J. Kim 32

Penetration Depth

PD determines the amount of repulsive forces in penalty-based, 6DOF haptic rendering

Penetration DepthShortest distance from the origin to the surface of convex Minkowski sum

Ewha Womans University http://graphics.ewha.ac.kr 33

0.3 sec0.3 sec 3.7 sec3.7 sec 1.9 sec1.9 sec 0.4 sec0.4 sec

Approximate Arrangement Computation

Application to global visibility and swept volume

Ewha Womans University http://graphics.ewha.ac.kr 35

Arrangement

An arrangement of geometric objects is the decomposition of space induced by given geometric primitives

The outer envelope is defined as a boundary of the cell in an arrangement, which can be reached from the infinity

A simple arrangement of 5 lines

[Halperin 97]

C1

C3

C2

C4

C1

C3

C2

C4

Ewha Womans University http://graphics.ewha.ac.kr 36

Motivations

Engine of a BMW 5 with 3,741,833 triangles

Car door with 782,018 triangles

[Ernst 04]

Ewha Womans University http://graphics.ewha.ac.kr 37

GoalRemove invisible geometric elements when the inspection is performed from outside only

Design reviewsVisual inspectionTraining simulations

Ewha Womans University http://graphics.ewha.ac.kr 38

Infinite Number of Viewpoint

Render the scene from infinite # of

viewpoint

[Ernst 04]

Ewha Womans University http://graphics.ewha.ac.kr 39

Main ContributionsRobust and practical approach to find invisible elements from a given scene database

Pose the problem as envelope computation

Use of GPUs to accelerate the computation

Ewha Womans University http://graphics.ewha.ac.kr 40

Algorithm Overview

Distance field representationsUse

GPUs

Fast marching method Use CPUs

Extract visible surfaceUse

CPUs

Ewha Womans University http://graphics.ewha.ac.kr 41

Directional Distance Fields3D voxel grid where each voxel contains a value of shortest distance to the surface

We compute directional distance fields for six principal directions (+x, -x, +y, -y, +z, -z)

Ewha Womans University http://graphics.ewha.ac.kr 42

Distance Fields Computations

zP

R

P

R

P

R

P

R

P

R

P

R

P

R

P

R

Ewha Womans University http://graphics.ewha.ac.kr 43

X

Y

Z = D

Distance Fields Computations

primitive

image plane

Z-buffer holds the directed distance values

projection

orthographic projection

Ewha Womans University http://graphics.ewha.ac.kr 44

Distance Fields Generation

Ewha Womans University http://graphics.ewha.ac.kr 45

Front Propagation

Initial Front

Final Front

Ewha Womans University http://graphics.ewha.ac.kr 46

Front Propagation Rules

D

d<D

1. Propagate

2. Don’t Propagate

3. Find envelope and don’t propagate

PQ

PQ

PQ

Ewha Womans University http://graphics.ewha.ac.kr 47

Front Propagation

Initial Front

Final Front

Ewha Womans University http://graphics.ewha.ac.kr 48

Extract Visible Surface

in out

outout

Ewha Womans University http://graphics.ewha.ac.kr 49

Implement EnvironmentMicrosoft Visual Studio .NetOpenGL, OpenSG libraryDual AMD Athlon 64 2.6GHz PC with nVIDIA GeForce 7900 GX2

Ewha Womans University http://graphics.ewha.ac.kr 50

Benchmarking Models

Car Model3M triangles

0.25K scene graph nodes

Engine Model0.3 M triangles

7K scene graph nodes

Ewha Womans University http://graphics.ewha.ac.kr 51

Results

Grid Resolution: 1283, Removal Rate: 71%

Ewha Womans University http://graphics.ewha.ac.kr 52

Results

Grid Resolution: 2563, Removal Rate: 69%

Ewha Womans University http://graphics.ewha.ac.kr 53

Results

Grid Resolution: 643 Removal Rate: 82%

Ewha Womans University http://graphics.ewha.ac.kr 54

Results

Grid Resolution: 1283 Removal Rate: 64%

Ewha Womans University http://graphics.ewha.ac.kr 55

Computation Time

ModelsGrid

resolution

directed distance field computation

time

Front propagation

timeCar

(247 nodes, 3M Tri.)

128 3.42sec 0.05sec

256 6.59sec 0.10sec

Engine(7177 nodes,

270K Tri.)

64 1.85sec 0.05sec

128 4.26sec 0.40sec

Average : 4.18sec

Sweep Trajectory Arrangement Boundary of SV

Application to Swept Volume

Computational Pipeline1. Enumerate surface primitives2. Compute their arrangement3. Traverse the arrangement and extract

the outermost boundary

Results

Ewha Womans University http://graphics.ewha.ac.kr 58

Trajectory

Sweep

Results

Ewha Womans University http://graphics.ewha.ac.kr 59

ReferencesXinyu Zhang, Young J. Kim, Interactive collision detection for deformable models using Streaming AABBs, IEEE Transactions on Visualization and Computer Graphics, 13(2), Mar/Apr,2007

Y. J. Kim, K. Hoff, M. C. Lin and D. Manocha, Closest point query among the union of convex polytopes using rasterization hardware, Journal of Graphics Tools, 7.4, 2003

민혜정, 이민경, 김영준, 대용량 모델 렌더링을 위한 전역적 가시화컬링 알고리즘, 한국 그래픽스 학회, Nov. 2006

Y. J. Kim, G. Varadhan, M. C. Lin and D. Manocha, Fast Swept Volume Approximation of Complex Polyhedral Models, Computer Aided Design , 36(11), Sep 2004.

Ewha Womans University http://graphics.ewha.ac.kr 60

Thank youQuestions to [email protected]

Ewha Womans University http://graphics.ewha.ac.kr 61