Accelerating Marching Cubes with Graphics Hardware
-
Upload
courtney-bryan -
Category
Documents
-
view
36 -
download
1
description
Transcript of Accelerating Marching Cubes with Graphics Hardware
![Page 1: Accelerating Marching Cubes with Graphics Hardware](https://reader035.fdocuments.in/reader035/viewer/2022062720/568134c8550346895d9bed4c/html5/thumbnails/1.jpg)
Accelerating Marching Cubes with Graphics
HardwareGunnar Johansson, Linköping UniversityHamish Carr, University College Dublin
![Page 2: Accelerating Marching Cubes with Graphics Hardware](https://reader035.fdocuments.in/reader035/viewer/2022062720/568134c8550346895d9bed4c/html5/thumbnails/2.jpg)
Presentation outline
• Goal• Background• Previous work• Our approach• Results• Conclusions, Future work
![Page 3: Accelerating Marching Cubes with Graphics Hardware](https://reader035.fdocuments.in/reader035/viewer/2022062720/568134c8550346895d9bed4c/html5/thumbnails/3.jpg)
Goal
• Isosurface visualization for studying 3D scalar functions– Marching Cubes is standard algorithm
• This work presents GPU acceleration in combination with CPU-based algorithmic acceleration (interval/Kd-trees)
![Page 4: Accelerating Marching Cubes with Graphics Hardware](https://reader035.fdocuments.in/reader035/viewer/2022062720/568134c8550346895d9bed4c/html5/thumbnails/4.jpg)
Background
![Page 5: Accelerating Marching Cubes with Graphics Hardware](https://reader035.fdocuments.in/reader035/viewer/2022062720/568134c8550346895d9bed4c/html5/thumbnails/5.jpg)
Isosurface visualization
• Goal: study a volumetric scalar function, f(x)
• Isosurface is a set of points with equal isovalue (h)
{ x : f(x) = h }
Illustration by
Stefan Roettger, University of Erlangen
![Page 6: Accelerating Marching Cubes with Graphics Hardware](https://reader035.fdocuments.in/reader035/viewer/2022062720/568134c8550346895d9bed4c/html5/thumbnails/6.jpg)
Marching Cubes
• Each corner of a cube is classified asabove (black), or below(white), a given isovalue
• Vertices of surface is linearly interpolated along the edges
• Normals are computed usingcentral differences and interpolated along the edges
![Page 7: Accelerating Marching Cubes with Graphics Hardware](https://reader035.fdocuments.in/reader035/viewer/2022062720/568134c8550346895d9bed4c/html5/thumbnails/7.jpg)
Marching Cubes
![Page 8: Accelerating Marching Cubes with Graphics Hardware](https://reader035.fdocuments.in/reader035/viewer/2022062720/568134c8550346895d9bed4c/html5/thumbnails/8.jpg)
Example application
• Studying medicaldatasets– MRI, CT scans
![Page 9: Accelerating Marching Cubes with Graphics Hardware](https://reader035.fdocuments.in/reader035/viewer/2022062720/568134c8550346895d9bed4c/html5/thumbnails/9.jpg)
Previous work
![Page 10: Accelerating Marching Cubes with Graphics Hardware](https://reader035.fdocuments.in/reader035/viewer/2022062720/568134c8550346895d9bed4c/html5/thumbnails/10.jpg)
Previous workAlgorithmic acceleration
• Original marching cubes visits all cells in the dataset– O(N) in time complexity, N = number of cells
• However, an isosurface is expected to intersect only a fraction of the cells
• Efficient search structures can be used to store maximum and minimum value of each cell– Kd-tree O(√N + k), k = size of isosurface– Interval tree O(log N + k)
![Page 11: Accelerating Marching Cubes with Graphics Hardware](https://reader035.fdocuments.in/reader035/viewer/2022062720/568134c8550346895d9bed4c/html5/thumbnails/11.jpg)
Previous workGPU acceleration
• Restricted to tetrahedral cells– Marching tetrahedra
• Pascucci, 04• Klein et al, 04• Reck et al, 04
• Cannot create/delete vertices on GPU– “Worst-case” strategy– Always fed 4 vertices (a quad) to the
GPU
![Page 12: Accelerating Marching Cubes with Graphics Hardware](https://reader035.fdocuments.in/reader035/viewer/2022062720/568134c8550346895d9bed4c/html5/thumbnails/12.jpg)
Previous workGPU acceleration
• CPU tasks– Selects cell and sends data to GPU
• GPU tasks– Classifies cell– Interpolates surface vertices– Compute normals (per face)
• Bottleneck?– Data transfer CPU – GPU
![Page 13: Accelerating Marching Cubes with Graphics Hardware](https://reader035.fdocuments.in/reader035/viewer/2022062720/568134c8550346895d9bed4c/html5/thumbnails/13.jpg)
Previous workGPU acceleration
• Parallel to our work– Goetz et al, “Real-time marching cubes
on the vertex shader”, 05
• Classifies cell on both CPU and GPU• Do not apply interval/Kd-trees• Only computes face normals
![Page 14: Accelerating Marching Cubes with Graphics Hardware](https://reader035.fdocuments.in/reader035/viewer/2022062720/568134c8550346895d9bed4c/html5/thumbnails/14.jpg)
Previous work
• Traditional pipeline(with accelerating search structures)
![Page 15: Accelerating Marching Cubes with Graphics Hardware](https://reader035.fdocuments.in/reader035/viewer/2022062720/568134c8550346895d9bed4c/html5/thumbnails/15.jpg)
Previous work
• GPU accelerated pipeline(by Pascucci / Reck et al / Klein et al)
![Page 16: Accelerating Marching Cubes with Graphics Hardware](https://reader035.fdocuments.in/reader035/viewer/2022062720/568134c8550346895d9bed4c/html5/thumbnails/16.jpg)
Our approach
![Page 17: Accelerating Marching Cubes with Graphics Hardware](https://reader035.fdocuments.in/reader035/viewer/2022062720/568134c8550346895d9bed4c/html5/thumbnails/17.jpg)
Our approach
• Marching cubes on GPU: Basic challenges– Cannot create vertices on GPU– Too costly to send all possible
triangulations (“worst-case” strategy)
![Page 18: Accelerating Marching Cubes with Graphics Hardware](https://reader035.fdocuments.in/reader035/viewer/2022062720/568134c8550346895d9bed4c/html5/thumbnails/18.jpg)
Our approach
• “Caching cell topology”– Store each case triangulation on the
GPU using display lists– Classify cell on CPU and invoke
corresponding display list– Minimize CPU – GPU bandwidth
bottleneck by storing dataset on GPU
![Page 19: Accelerating Marching Cubes with Graphics Hardware](https://reader035.fdocuments.in/reader035/viewer/2022062720/568134c8550346895d9bed4c/html5/thumbnails/19.jpg)
Our approach
• “Caching cell topology”
![Page 20: Accelerating Marching Cubes with Graphics Hardware](https://reader035.fdocuments.in/reader035/viewer/2022062720/568134c8550346895d9bed4c/html5/thumbnails/20.jpg)
Our approach
• Display list stores corner indices• Use indices for texture lookup• Use values from texture
to interpolate verticesand normals
0
7 6
54
3 2
1(0,1)
(0,3)
(0,4)
![Page 21: Accelerating Marching Cubes with Graphics Hardware](https://reader035.fdocuments.in/reader035/viewer/2022062720/568134c8550346895d9bed4c/html5/thumbnails/21.jpg)
Our approach
• Case classification still a CPU bottleneck?
![Page 22: Accelerating Marching Cubes with Graphics Hardware](https://reader035.fdocuments.in/reader035/viewer/2022062720/568134c8550346895d9bed4c/html5/thumbnails/22.jpg)
Our approach
• Accelerate case classification by“pre-computing cell topology”
• Pre-compute possiblecases for each cell
• Store all intervalswith correspondingcase in intervalor Kd-tree
![Page 23: Accelerating Marching Cubes with Graphics Hardware](https://reader035.fdocuments.in/reader035/viewer/2022062720/568134c8550346895d9bed4c/html5/thumbnails/23.jpg)
Our approach
• “Case interval/Kd-tree”– Shifts case classification to pre-
computation– Storage requirements increase for noisy
dataset (as much as 7 times)
![Page 24: Accelerating Marching Cubes with Graphics Hardware](https://reader035.fdocuments.in/reader035/viewer/2022062720/568134c8550346895d9bed4c/html5/thumbnails/24.jpg)
Results
![Page 25: Accelerating Marching Cubes with Graphics Hardware](https://reader035.fdocuments.in/reader035/viewer/2022062720/568134c8550346895d9bed4c/html5/thumbnails/25.jpg)
Results
• First approach– Store dataset packed in 2D 1-channel
float texture– Central differencing on GPU for normals– Results disappointing
• 1.2-1.6 speedup for Marching Cubes without accelerating structures
• Even decrease in speedup when using accelerating structures: GPU bottleneck
![Page 26: Accelerating Marching Cubes with Graphics Hardware](https://reader035.fdocuments.in/reader035/viewer/2022062720/568134c8550346895d9bed4c/html5/thumbnails/26.jpg)
Results
• Vertex texture support is currently poor– Only 2D 1/4–channel floats– High latency
• Central differencing– 12 texture lookups per vertex normal
• 14 lookups in total for each vertex
![Page 27: Accelerating Marching Cubes with Graphics Hardware](https://reader035.fdocuments.in/reader035/viewer/2022062720/568134c8550346895d9bed4c/html5/thumbnails/27.jpg)
Results
• Second approach– Pre-compute normals and store dataset and
normals packed in 2D 4-channel float texture
– Only need 2 lookups for each vertex– Results improved
• Speedup of 3-4 times compared with CPU counterpart
• 128x128x128 “Hydrogen atom” dataset– Interval tree + CPU: 27 fps– Interval tree + GPU: 112 fps (4 times speedup)
![Page 28: Accelerating Marching Cubes with Graphics Hardware](https://reader035.fdocuments.in/reader035/viewer/2022062720/568134c8550346895d9bed4c/html5/thumbnails/28.jpg)
Conclusions
• Accelerating isosurface extractionusing GPU– Cache all possible cell triangulations
(cases)– Use CPU for classification– Use GPU for interpolation– Optimize CPU classification by pre-
computing all possible cases (case interval/Kd-tree)
![Page 29: Accelerating Marching Cubes with Graphics Hardware](https://reader035.fdocuments.in/reader035/viewer/2022062720/568134c8550346895d9bed4c/html5/thumbnails/29.jpg)
Conclusions
• Applicable to any interpolant (in this work described using Marching Cubes)
• Current hardware impose restrictions– Float textures, high latency for vertex
texture lookup
![Page 30: Accelerating Marching Cubes with Graphics Hardware](https://reader035.fdocuments.in/reader035/viewer/2022062720/568134c8550346895d9bed4c/html5/thumbnails/30.jpg)
Future work
• Move computation to fragment processor– More powerful than vertex processor– Better, more efficient texture support– Ability to download (to CPU) the
extracted surface
• Optimize memory usage (texture/system)
• Apply to higher-order interpolants
![Page 31: Accelerating Marching Cubes with Graphics Hardware](https://reader035.fdocuments.in/reader035/viewer/2022062720/568134c8550346895d9bed4c/html5/thumbnails/31.jpg)
Thank you
Acknowledgements:Thanks to UCD for funding