DiFi: Distance Fields - Fast Computation Using Graphics Hardware

Similar documents
Fast Computation of Generalized Voronoi Diagrams Using Graphics Hardware

DiFi: Fast Distance Field Computation using Graphics Hardware

Goal. Interactive Walkthroughs using Multiple GPUs. Boeing 777. DoubleEagle Tanker Model

Occluder Simplification using Planar Sections

DiFi: Fast 3D Distance Field Computation Using Graphics Hardware

ACCELERATING ROUTE PLANNING AND COLLISION DETECTION FOR COMPUTER GENERATED FORCES USING GPUS

A Fast Method for Local Penetration Depth Computation. Stephane Redon and Ming C. Lin

Visibility and Occlusion Culling

Collision Detection. These slides are mainly from Ming Lin s course notes at UNC Chapel Hill

Spatial Data Structures and Speed-Up Techniques. Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology

CS GPU and GPGPU Programming Lecture 2: Introduction; GPU Architecture 1. Markus Hadwiger, KAUST

Accelerating Geometric Queries. Computer Graphics CMU /15-662, Fall 2016

Image-Space Techniques

CS 498 VR. Lecture 18-4/4/18. go.illinois.edu/vrlect18

Construction of Voronoi Diagrams

Interactive Ray Tracing: Higher Memory Coherence

3D Rasterization II COS 426

Rendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane

Cloth Simulation on the GPU. Cyril Zeller NVIDIA Corporation

Visible Surface Detection. (Chapt. 15 in FVD, Chapt. 13 in Hearn & Baker)

Closest Point Query Among The Union Of Convex Polytopes Using Rasterization Hardware

Lecture 13: Reyes Architecture and Implementation. Kayvon Fatahalian CMU : Graphics and Imaging Architectures (Fall 2011)

Collision Detection II. These slides are mainly from Ming Lin s course notes at UNC Chapel Hill

TSBK03 Screen-Space Ambient Occlusion

Adaptive Point Cloud Rendering

Simulation in Computer Graphics Space Subdivision. Matthias Teschner

Page 1. Area-Subdivision Algorithms z-buffer Algorithm List Priority Algorithms BSP (Binary Space Partitioning Tree) Scan-line Algorithms

CS 563 Advanced Topics in Computer Graphics Culling and Acceleration Techniques Part 1 by Mark Vessella

Direct Rendering. Direct Rendering Goals

Fast Line-of-Sight Computations in Complex Environments

Fast continuous collision detection among deformable Models using graphics processors CS-525 Presentation Presented by Harish

2.11 Particle Systems

Collision and Proximity Queries

EECE 478. Learning Objectives. Learning Objectives. Rasterization & Scenes. Rasterization. Compositing

Collision Detection based on Spatial Partitioning

Ray Casting on Programmable Graphics Hardware. Martin Kraus PURPL group, Purdue University

References. Additional lecture notes for 2/18/02.

CSE 167: Lecture #5: Rasterization. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

Geometric Modeling in Graphics

Fast 3D Geometric Proximity Queries between Rigid and Deformable Models Using Graphics Hardware Acceleration

FRUSTUM-TRACED RASTER SHADOWS: REVISITING IRREGULAR Z-BUFFERS

Graphics Processing Unit Architecture (GPU Arch)

An Efficient Approach for Emphasizing Regions of Interest in Ray-Casting based Volume Rendering

CS230 : Computer Graphics Lecture 4. Tamar Shinar Computer Science & Engineering UC Riverside

CSE 167: Introduction to Computer Graphics Lecture #9: Visibility. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2018

Two Converging Trends in Computing. Streaming Geometric Computations on the GPU. What is a Stream? Streaming Model

FRUSTUM-TRACED RASTER SHADOWS: REVISITING IRREGULAR Z-BUFFERS

Graphics and Interaction Rendering pipeline & object modelling

Many rendering scenarios, such as battle scenes or urban environments, require rendering of large numbers of autonomous characters.

Computer Graphics. Bing-Yu Chen National Taiwan University The University of Tokyo

Some Thoughts on Visibility

CPSC GLOBAL ILLUMINATION

CSE 167: Introduction to Computer Graphics Lecture #5: Rasterization. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2015

Week 8 Voronoi Diagrams

11/1/13. Visualization. Scientific Visualization. Types of Data. Height Field. Contour Curves. Meshes

Visualization. CSCI 420 Computer Graphics Lecture 26

GPU-Based Visualization of AMR and N-Body Dark Matter Simulation Data. Ralf Kähler (KIPAC/SLAC)

Interactive View-Dependent Rendering with Conservative Occlusion Culling in Complex Environments

Direct Rendering of Trimmed NURBS Surfaces

9. Visible-Surface Detection Methods

Fast Proximity Computation among Deformable Models Using Discrete Voronoi Diagrams

Subdivision Of Triangular Terrain Mesh Breckon, Chenney, Hobbs, Hoppe, Watts

Ray Tracing. Computer Graphics CMU /15-662, Fall 2016

Signed Distance Transform Using Graphics Hardware

Signed Distance Transform Using Graphics Hardware

Wed, October 12, 2011

GPU Computation Strategies & Tricks. Ian Buck NVIDIA

Spatial Data Structures and Acceleration Algorithms

L10 Layered Depth Normal Images. Introduction Related Work Structured Point Representation Boolean Operations Conclusion

Clipping. CSC 7443: Scientific Information Visualization

CC Shadow Volumes. Abstract. Introduction

First Steps in Hardware Two-Level Volume Rendering

CS4620/5620: Lecture 14 Pipeline

L1 - Introduction. Contents. Introduction of CAD/CAM system Components of CAD/CAM systems Basic concepts of graphics programming

A Bandwidth Effective Rendering Scheme for 3D Texture-based Volume Visualization on GPU

Visualization Computer Graphics I Lecture 20

CSE 167: Introduction to Computer Graphics Lecture #18: More Effects. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016

Scene Management. Video Game Technologies 11498: MSc in Computer Science and Engineering 11156: MSc in Game Design and Development

Hidden surface removal. Computer Graphics

Real-Time Reyes: Programmable Pipelines and Research Challenges. Anjul Patney University of California, Davis

Project Gotham Racing 2 (Xbox) Real-Time Rendering. Microsoft Flighsimulator. Halflife 2

Visibility. Tom Funkhouser COS 526, Fall Slides mostly by Frédo Durand

CS535 Fall Department of Computer Science Purdue University

CS130 : Computer Graphics. Tamar Shinar Computer Science & Engineering UC Riverside

Visualization Computer Graphics I Lecture 20

Height Fields and Contours Scalar Fields Volume Rendering Vector Fields [Angel Ch. 12] April 23, 2002 Frank Pfenning Carnegie Mellon University

Computer Graphics Shadow Algorithms

CS 563 Advanced Topics in Computer Graphics QSplat. by Matt Maziarz

Volume Illumination and Segmentation

Hidden Surface Removal

Lecture notes: Object modeling

Generalized Higher-Order Voronoi Diagrams on Polyhedral Surfaces

Ray Casting of Trimmed NURBS Surfaces on the GPU

Pipeline Operations. CS 4620 Lecture 10

Homework 1: Implicit Surfaces, Collision Detection, & Volumetric Data Structures. Loop Subdivision. Loop Subdivision. Questions/Comments?

Two basic types: image-precision and object-precision. Image-precision For each pixel, determine which object is visable Requires np operations

The Rasterization Pipeline

Visualization. Images are used to aid in understanding of data. Height Fields and Contours Scalar Fields Volume Rendering Vector Fields [chapter 26]

Interactive Collision Detection for Engineering Plants based on Large-Scale Point-Clouds

LOD and Occlusion Christian Miller CS Fall 2011

Transcription:

DiFi: Distance Fields - Fast Computation Using Graphics Hardware Avneesh Sud Dinesh Manocha UNC-Chapel Hill http://gamma.cs.unc.edu/difi

Distance Fields Distance Function For a site a scalar function f:r n -> R representing the distance from a point P e R n to the site Distance Field For a set of sites, the minima of all distance functions representing the distance from a point P e R n to closest site

What is a Voronoi Diagram? Given a collection of geometric primitives, it is a subdivision of space into cells such that all points in a cell are closer to one primitive than to any other Voronoi Site Voronoi Region

Ordinary Point sites Nearest Euclidean distance Higher-order Sites Generalized Higher-order site geometry Varying distance metrics 2.0 0.5 Weighted Distances

Voronoi Diagram and Distance Fields Minimization diagram of distance functions generates a Voronoi Diagram [Sharir94] Projection of lower envelope of distance functions

Why Should We Compute Them? Useful in a wide variety of applications Collision Detection Surface Reconstruction Robot Motion Planning Non-Photorealistic Rendering Surface Simplification Mesh Generation Shape Analysis

GPU Based Computation HAVOC2D, HAVOC3D [Hoff99] Evaluate distance at each pixel for all sites Accelerate using graphics hardware Point Line Triangle

GPU Based Computation HAVOC2D, HAVOC3D [Hoff99] Evaluate distance at each pixel for all sites Accelerate using graphics hardware Steps Mesh approximation of Distance Functions Render distance meshes using graphics hardware Readback final buffers

Approximating the Distance Function Avoid per-pixel distance evaluation Point-sample the distance function Reconstruct by rendering polygonal mesh Point Line Triangle

Meshing the Distance Function Shape of distance function for a 2D point is a cone Need a bounded-error tessellation of the cone

Graphics Hardware Acceleration Rasterization to reconstruct distance values Depth test to perform minimum operator Perspective, 3/4 view Parallel, top view

Readback Results Color Buffer Depth Buffer Voronoi Regions Distance Field

3D Voronoi Diagrams Graphics hardware can generate one 2D slice at a time Sweep along 3 rd dimension (Zaxis) computing 1 slice at a time Polygonal model

Shape of 3D Distance Functions Slices of the distance function for a 3D point site Distance meshes used to approximate slices

Shape of 3D Distance Functions Point Line segment Triangle 1 sheet of a hyperboloid Elliptical cone Plane

Bottlenecks Rasterization: Distance mesh can fill entire slice Complexity for n sites and k slices = O(kn) Lot of Fill! Readback: Stalls the graphics pipeline Unsuitable for interactive applications

Outline Overview Culling Techniques Application Implementation and Results Demo!

Outline Overview Culling Techniques Application Implementation and Results Demo!

Overview: Framework Previous application framework GPU Render Distance Field Readback CPU Filter Distance Field Results

Overview Reduce fill: Cull using estimated voronoi region bounds GPU Render Distance Field Readback CPU Filter Distance Field Results

Overview Reduce fill: Cull using estimated voronoi region bounds Along Z: Cull sites whose voronoi regions don t intersect with current slice In XY plane: Restrict fill per site using planar bounds of the voronoi region

Overview: Framework Avoid readback: Perform distance field application on GPU GPU Render Distance Field Readback CPU Filter Distance Field Results

Voronoi Diagram Properties Within a bounded region, all voronoi regions have a bounded volume 9 Sites, 2D

Voronoi Diagram Properties Within a bounded region, all voronoi regions have a bounded volume As site density increases, average spatial bounds decrease 27 Sites, 2D

Voronoi Diagram Properties Voronoi regions are connected Valid for L 2, L inf norms

Voronoi Diagram Properties High distance field coherence between adjacent slices Change in distance function between adjacent slices is bounded Distance functions for a point site P i to slice Z j

Voronoi Diagram Properties High distance field coherence between adjacent slices Change in distance function between adjacent slices is bounded Distance functions for a point site P i to slice Z j+1

Outline Overview Culling Techniques Site Classification Estimating Z-Bounds Estimating XY-Bounds Applications Implementation and Results Demo!

Outline Overview Culling Techniques Site Classification Estimating Z-Bounds Estimating XY-Bounds Applications Implementation and Results Demo!

Site Culling: Classification For each slice partition the set of sites Slice j S 1 S 3 S 2 S 5 X Z S 4 Sweep Direction

Site Culling: Classification For each slice partition the set of sites, using voronoi region bounds: S 1 Slice j S 2 S 3 S 5 X Z S 4 Sweep Direction

Site Culling: Classification For each slice partition the set of sites, using voronoi region bounds: Approaching (A j ) Slice j S S 1 3 S 2 A j S 5 X S 4 Z Sweep Direction

Site Culling: Classification For each slice partition the set of sites, using voronoi region bounds: Approaching (A j ) Intersecting (I j ) X Z Slice j S 1 S 3 S 2 S 4 Sweep Direction A j I j S 5

Site Culling: Classification For each slice partition the set of sites, using voronoi region bounds: Approaching (A j ) Intersecting (I j ) Receding (R j ) X R j Z Slice j S 1 S 3 S 2 S 4 I j Sweep Direction A j S 5

Site Culling: Classification For each slice partition the set of sites, using voronoi region bounds: Approaching (A j ) Intersecting (I j ) Receding (R j ) Render distance functions for Intersecting sites only X R j Z Slice j S 1 S 3 S 2 S 4 I j Sweep Direction A j S 5

Coherence Updating I j I j+1 = I j Previously Intersecting Slice j+1 S 1 S 3 S 2 X Z S 4 Sweep Direction I j S 5

Coherence Updating I j I j+1 = I j + (A j A j+1 ) Approaching Intersecting Slice j+1 S 1 S 3 S 2 A j -A j+1 S 5 X Z S 4 Sweep Direction

Coherence Updating I j I j+1 = I j + (A j A j+1 ) (R j+1 R j ) Slice j+1 S 1 S 3 Intersecting Receding R j+1 -R j S 2 S 5 X Z S 4 Sweep Direction

Coherence Updating I j I j+1 = I j + (A j A j+1 ) (R j+1 R j ) Slice j+1 S 1 S 3 R j+1 S 2 I j+1 A j+1 X Z S 4 S 5 Sweep Direction

Outline Overview Culling Techniques Site Classification Estimating Z-Bounds Estimating XY-Bounds Applications Implementation and Results Demo!

Estimating Set Partitions Computing exact set partition = Exact voronoi computation Use hardware based occlusion queries Determine number of visible fragments Compute a set of potentially intersecting sites Î j Iˆ j I j

Estimating Z-Bounds Use BB tests to cull away approaching sites (A j ) Non-culled sites moved from A j to Î j+1 Render Î j+1 using occlusion queries Occluded sites moved from Î j to R j+1 Discarded for all further slices

Outline Overview Culling Techniques Site Classification Estimating Z-Bounds Estimating XY-Bounds Applications Implementation and Results Demo!

Estimating XY Bounds Monotonic distance functions

Estimating XY Bounds Monotonic distance functions Voronoi region s XY extent bounded by depth of distance function

Estimating XY Bounds Monotonic distance functions Voronoi region s XY extent bounded by depth of distance function Estimate max depth bounds for each site!

Estimating Depth Bound Render distance function in layers using occlusion query

Estimating Depth Bound Render distance field in layers using occlusion query

Estimating Depth Bound Render distance field in layers using occlusion query

Estimating Depth Bound Render distance field in layers using occlusion query First completely occluded layer bounds the max depth

Estimating Depth Bound Render distance field in layers using occlusion query First completely occluded layer bounds the max depth

Updating Depth Bound Exploit depth field coherence Given a depth bound for current slice, estimate a bound for next slice

Outline Overview Culling Techniques Applications Implementation and Results Demo!

Application: GPU Computation Avoid frame buffer readback GPU Render Distance Field Readback CPU Filter Distance Field Results

Application: GPU Computation GPU Avoid frame buffer readback Distance Field is a 3D grid : SIMD applications suitable for GPU computation Render Distance Field Copy to Texture Run Fragment Program Readback Results

GPU Application: GPU Computation Size of Results << Size of Distance Field Readback cost of results << Readback of Distance Field Render Distance Field Copy to Texture Run Fragment Program Readback Results

Application: Simplified MAT Foskey03: Separation criteria to extract a simplified medial axis

Blum Medial Axis Locus of centers of maximal contained balls Well-understood medial representation Applications Shape analysis Mesh generation Motion planning

T -Simplified Medial Axis M q A subset of the full medial axis M Relies on separation angle S(x)

Separation Angle Angle separating the vectors from x to nearest neighbors If more than 2 nearest neighbors, maximum angle is used x p 1 S(x) p 2

Large Separation Angle Point is roughly between its nearest neighbor points x

Small Separation Angle Point is off to one side of its nearest neighbor points x

Definition M θ = {x M S(x) > θ } Start with medial axis M Throw out all points with S(x) θ

3D Example: Triceratops q = 15 q = 30 q = 60

Direction Field Gradient of Distance Field Direction image rendered for each slice (constant z) Direction vectors encoded as RGB triples Length encoded in depth buffer

Direction Field

Direction Field

Adding Voxel Faces

Adding Voxel Faces

Adding Voxel Faces

Approximates True Medial Axis

Application: Simplified MAT GPU based computation GPU Render Direction Distance Field Copy to Float Readback Texture Frag. Filter Noise, Prog: Distance Add Separation Voxel Field Faces Filter Volume Render Results Render using with Quads 3D Tex

Outline Overview Culling Techniques Applications Medial Axis Computation Proximity Queries Implementation and Results Demo!

Implementation Dell Workstation with Pentium4 CPU at 2.8Ghz nvidia GeForce FX5800 Ultra GPU 2GB RAM Windows 2000

Results: MAT Computation Total time = Time(Direction Field) + Time(Filter Voxels)

Direction Field Computation 4-20 times speedup! Model Polys Resolution HAVOC (s) DiFi (s) Shell Charge 4460 128x126x126 31.69 3.38 Head 21764 79x106x128 52.47 13.60 Bunny 69451 128x126x100 212.71 36.21 Cassini 90879 94x128x96 1102.01 47.90

Filter Voxels 2-75 times speedup! Model Resolution CPU (s) GPU (s) Shell Charge 128x126x126 3.50 0.14 Head 79x106x128 0.18 0.08 Bunny 128x126x100 0.68 0.13 Cassini 94x128x96 7.59 0.1

Outline Overview Culling Techniques Applications Medial Axis Computation Proximity Queries Results Demo!

Demo: MAT computation Triceratops model Shell model : CAD model Sharp edges, hence point sampling methods not adequate Non-manifold

Future Work Distance field computation: Not quite real time for large models Applications: Proximity Queries and Collision Detection

References A. Sud and D. Manocha. DiFi: Fast distance field computation using graphics hardware. UNC-CH Computer Science Technical Report TR03-026, 2003 http://gamma.cs.unc.edu/difi M. Foskey, M. Lin, and D. Manocha. Efficient computation of a simplified medial axis. Proc. of ACM Solid Modeling, 2003.

Acknowledgements Sponsors Greg Coombe, Mark Harris Mark Foskey Naga Govindaraju UNC GAMMA group

The End