real-time volume graphics markus hadwiger vrvis research center, vienna eurographics 2006 real-time...

32
REAL-TIME VOLUME GRAPHICS Markus Hadwiger VRVis Research Center, Vienna Eurographics 2006 Real-Time Volume Graphics [04] GPU-Based Ray-Casting

Upload: bernard-stevenson

Post on 29-Dec-2015

220 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: REAL-TIME VOLUME GRAPHICS Markus Hadwiger VRVis Research Center, Vienna Eurographics 2006 Real-Time Volume Graphics [04] GPU-Based Ray-Casting

REAL-TIME VOLUME GRAPHICSMarkus HadwigerVRVis Research Center, Vienna Eurographics 2006

Real-Time Volume Graphics

[04] GPU-Based Ray-Casting

Page 2: REAL-TIME VOLUME GRAPHICS Markus Hadwiger VRVis Research Center, Vienna Eurographics 2006 Real-Time Volume Graphics [04] GPU-Based Ray-Casting

REAL-TIME VOLUME GRAPHICSMarkus HadwigerVRVis Research Center, Vienna Eurographics 2006

Talk Outline

Why use ray-casting instead of slicing?Ray-casting of rectilinear (structured) grids

Basic approaches on GPUsBasic acceleration methodsObject-order empty space skippingIsosurface ray-castingEndoscopic ray-casting

Page 3: REAL-TIME VOLUME GRAPHICS Markus Hadwiger VRVis Research Center, Vienna Eurographics 2006 Real-Time Volume Graphics [04] GPU-Based Ray-Casting

REAL-TIME VOLUME GRAPHICSMarkus HadwigerVRVis Research Center, Vienna Eurographics 2006

Why Ray-Casting on GPUs?Most GPU rendering is object-order (rasterization)Image-order is more “CPU-like”

Recent fragment shader advancesSimpler to implementVery flexible (e.g., adaptive sampling)Correct perspectiveprojectionCan be implementedin single pass!Native 32-bitcompositing

Page 4: REAL-TIME VOLUME GRAPHICS Markus Hadwiger VRVis Research Center, Vienna Eurographics 2006 Real-Time Volume Graphics [04] GPU-Based Ray-Casting

REAL-TIME VOLUME GRAPHICSMarkus HadwigerVRVis Research Center, Vienna Eurographics 2006

Where Is Correct Perspective Needed?

Entering the volumeWide field of view

Fly-throughsVirtual endoscopyIntegration intoperspective scenes,e.g., games

Page 5: REAL-TIME VOLUME GRAPHICS Markus Hadwiger VRVis Research Center, Vienna Eurographics 2006 Real-Time Volume Graphics [04] GPU-Based Ray-Casting

REAL-TIME VOLUME GRAPHICSMarkus HadwigerVRVis Research Center, Vienna Eurographics 2006

Recent GPU Ray-Casting Approaches

Rectilinear grids[Krüger and Westermann, 2003][Röttger et al., 2003][Green, 2004] (NVIDIA SDK Example)[Stegmaier et al., 2005][Scharsach et al., 2006]

Unstructured (tetrahedral) grids[Weiler et al., 2002, 2003, 2004][Bernardon, 2004]

Page 6: REAL-TIME VOLUME GRAPHICS Markus Hadwiger VRVis Research Center, Vienna Eurographics 2006 Real-Time Volume Graphics [04] GPU-Based Ray-Casting

REAL-TIME VOLUME GRAPHICSMarkus HadwigerVRVis Research Center, Vienna Eurographics 2006

Single-Pass Ray-Casting

Enabled by conditional loops in fragment shaders (Shader Model 3; e.g., Geforce 6800, ATI X1800)Substitute multiple passes and early-z testing by single loop and early loop exitNo compositing buffer: full 32-bit precision!

NVIDIA example: compute rayintersections with bounding box,march along rays and composite

Page 7: REAL-TIME VOLUME GRAPHICS Markus Hadwiger VRVis Research Center, Vienna Eurographics 2006 Real-Time Volume Graphics [04] GPU-Based Ray-Casting

REAL-TIME VOLUME GRAPHICSMarkus HadwigerVRVis Research Center, Vienna Eurographics 2006

Basic Ray Setup / Termination

Two main approaches:Procedural ray/box intersection[Röttger et al., 2003], [Green, 2004]Rasterize bounding box[Krüger and Westermann, 2003]

Some possibilitiesRay start position and exit checkRay start position and exit positionRay start position and direction vector

Page 8: REAL-TIME VOLUME GRAPHICS Markus Hadwiger VRVis Research Center, Vienna Eurographics 2006 Real-Time Volume Graphics [04] GPU-Based Ray-Casting

REAL-TIME VOLUME GRAPHICSMarkus HadwigerVRVis Research Center, Vienna Eurographics 2006

Procedural Ray Setup/Termination

Everything handled in the fragment shaderProcedural ray / bounding box intersection

Ray is given by camera positionand volume entry positionExit criterion needed

Pro: simple and self-containedCon: full load on the fragment shader

Page 9: REAL-TIME VOLUME GRAPHICS Markus Hadwiger VRVis Research Center, Vienna Eurographics 2006 Real-Time Volume Graphics [04] GPU-Based Ray-Casting

REAL-TIME VOLUME GRAPHICSMarkus HadwigerVRVis Research Center, Vienna Eurographics 2006

Fragment Shader

Rasterize front facesof volume bounding box

Texcoords are volumeposition in [0,1]Subtract camera position

Repeatedly check forexit of bounding box

Page 10: REAL-TIME VOLUME GRAPHICS Markus Hadwiger VRVis Research Center, Vienna Eurographics 2006 Real-Time Volume Graphics [04] GPU-Based Ray-Casting

REAL-TIME VOLUME GRAPHICSMarkus HadwigerVRVis Research Center, Vienna Eurographics 2006

- =

"Image-Based" Ray Setup/Termination

Rasterize bounding box front faces and back faces[Krüger and Westermann, 2003]Ray start position: front facesDirection vector: back−front faces

Independent of projection (orthogonal/perspective)

Page 11: REAL-TIME VOLUME GRAPHICS Markus Hadwiger VRVis Research Center, Vienna Eurographics 2006 Real-Time Volume Graphics [04] GPU-Based Ray-Casting

REAL-TIME VOLUME GRAPHICSMarkus HadwigerVRVis Research Center, Vienna Eurographics 2006

Standard Ray-Casting Optimizations (1)

Early ray terminationIsosurfaces: stop when surface hitDirect volume rendering:stop when opacity >= threshold

Several possibilitiesOlder GPUs: multi-pass rendering with early-z testShader model 3: break out of ray-casting loopCurrent GPUs: early loop exit not optimal but good

Page 12: REAL-TIME VOLUME GRAPHICS Markus Hadwiger VRVis Research Center, Vienna Eurographics 2006 Real-Time Volume Graphics [04] GPU-Based Ray-Casting

REAL-TIME VOLUME GRAPHICSMarkus HadwigerVRVis Research Center, Vienna Eurographics 2006

Standard Ray-Casting Optimizations (2)

Empty space skippingSkip transparent samplesDepends on transfer functionStart casting close to first hit

Several possibilitiesPer-sample check of opacity (expensive)Traverse hierarchy (e.g., octree) or regular grid

These are image-order: what about object-order?

Page 13: REAL-TIME VOLUME GRAPHICS Markus Hadwiger VRVis Research Center, Vienna Eurographics 2006 Real-Time Volume Graphics [04] GPU-Based Ray-Casting

REAL-TIME VOLUME GRAPHICSMarkus HadwigerVRVis Research Center, Vienna Eurographics 2006

Object-Order Empty Space Skipping (1)

Modify initial rasterization step

rasterize bounding box rasterize “tight" bounding geometry

Page 14: REAL-TIME VOLUME GRAPHICS Markus Hadwiger VRVis Research Center, Vienna Eurographics 2006 Real-Time Volume Graphics [04] GPU-Based Ray-Casting

REAL-TIME VOLUME GRAPHICSMarkus HadwigerVRVis Research Center, Vienna Eurographics 2006

Object-Order Empty Space Skipping (2)

Store min-max values of volume bricksCull bricks against isovalue or transfer functionRasterize front and back faces of active bricks

Page 15: REAL-TIME VOLUME GRAPHICS Markus Hadwiger VRVis Research Center, Vienna Eurographics 2006 Real-Time Volume Graphics [04] GPU-Based Ray-Casting

REAL-TIME VOLUME GRAPHICSMarkus HadwigerVRVis Research Center, Vienna Eurographics 2006

Object-Order Empty Space Skipping (3)

Rasterize front and back facesof active min-max bricksStart rays on brick front facesTerminate when

Full opacity reached, orBack face reached

Page 16: REAL-TIME VOLUME GRAPHICS Markus Hadwiger VRVis Research Center, Vienna Eurographics 2006 Real-Time Volume Graphics [04] GPU-Based Ray-Casting

REAL-TIME VOLUME GRAPHICSMarkus HadwigerVRVis Research Center, Vienna Eurographics 2006

Object-Order Empty Space Skipping (3)

Rasterize front and back facesof active min-max bricksStart rays on brick front facesTerminate when

Full opacity reached, orBack face reached

Not all empty spaceis skipped

Page 17: REAL-TIME VOLUME GRAPHICS Markus Hadwiger VRVis Research Center, Vienna Eurographics 2006 Real-Time Volume Graphics [04] GPU-Based Ray-Casting

REAL-TIME VOLUME GRAPHICSMarkus HadwigerVRVis Research Center, Vienna Eurographics 2006

Isosurface Ray-Casting

Isosurfaces/Level Setsscanned datadistance fieldsCSG operationslevel sets: surface editing, simulation, segmentation, …

Page 18: REAL-TIME VOLUME GRAPHICS Markus Hadwiger VRVis Research Center, Vienna Eurographics 2006 Real-Time Volume Graphics [04] GPU-Based Ray-Casting

REAL-TIME VOLUME GRAPHICSMarkus HadwigerVRVis Research Center, Vienna Eurographics 2006

Intersection Refinement (1)

Fixed number of bisection or binary search stepsVirtually no impact on performance

Refine already detectedintersectionHandle problems with smallfeatures / at silhouettes withadaptive sampling

Page 19: REAL-TIME VOLUME GRAPHICS Markus Hadwiger VRVis Research Center, Vienna Eurographics 2006 Real-Time Volume Graphics [04] GPU-Based Ray-Casting

REAL-TIME VOLUME GRAPHICSMarkus HadwigerVRVis Research Center, Vienna Eurographics 2006

Intersection Refinement (2)

without refinement with refinement

sampling rate 1/5 voxel (no adaptive sampling)

Page 20: REAL-TIME VOLUME GRAPHICS Markus Hadwiger VRVis Research Center, Vienna Eurographics 2006 Real-Time Volume Graphics [04] GPU-Based Ray-Casting

REAL-TIME VOLUME GRAPHICSMarkus HadwigerVRVis Research Center, Vienna Eurographics 2006

Intersection Refinement (3)

Sampling distance 1.0, 24 fps Sampling distance 5.0, 66 fps

Page 21: REAL-TIME VOLUME GRAPHICS Markus Hadwiger VRVis Research Center, Vienna Eurographics 2006 Real-Time Volume Graphics [04] GPU-Based Ray-Casting

REAL-TIME VOLUME GRAPHICSMarkus HadwigerVRVis Research Center, Vienna Eurographics 2006

Deferred Isosurface Shading

Shading is expensiveGradient computation; conditional execution not free

Ray-casting step computes only intersection image

Page 22: REAL-TIME VOLUME GRAPHICS Markus Hadwiger VRVis Research Center, Vienna Eurographics 2006 Real-Time Volume Graphics [04] GPU-Based Ray-Casting

REAL-TIME VOLUME GRAPHICSMarkus HadwigerVRVis Research Center, Vienna Eurographics 2006

Enhancements (1)Build on image-based ray setupAllow viewpoint inside the volume

Intersect polygonal geometry

Page 23: REAL-TIME VOLUME GRAPHICS Markus Hadwiger VRVis Research Center, Vienna Eurographics 2006 Real-Time Volume Graphics [04] GPU-Based Ray-Casting

REAL-TIME VOLUME GRAPHICSMarkus HadwigerVRVis Research Center, Vienna Eurographics 2006

Enhancements (2)1. Starting position computation

Ray start position image

2. Ray length computation Ray length image

3. Render polygonal geometry Modified ray length image

4. Raycasting Compositing buffer

5. Blending Final image

Page 24: REAL-TIME VOLUME GRAPHICS Markus Hadwiger VRVis Research Center, Vienna Eurographics 2006 Real-Time Volume Graphics [04] GPU-Based Ray-Casting

REAL-TIME VOLUME GRAPHICSMarkus HadwigerVRVis Research Center, Vienna Eurographics 2006

Moving Into The Volume (1)Near clipping plane clips into front faces

Fill in holes with near clipping planeCan use depth buffer [Scharsach et al., 2006]

Page 25: REAL-TIME VOLUME GRAPHICS Markus Hadwiger VRVis Research Center, Vienna Eurographics 2006 Real-Time Volume Graphics [04] GPU-Based Ray-Casting

REAL-TIME VOLUME GRAPHICSMarkus HadwigerVRVis Research Center, Vienna Eurographics 2006

Moving Into The Volume (2)

1. Rasterize near clipping planeDisable depth buffer, enable color bufferRasterize entire near clipping plane

2. Rasterize nearest back facesEnable depth buffer, disable color bufferRasterize nearest back faces of active bricks

3. Rasterize nearest front facesEnable depth buffer, enable color bufferRasterize nearest front faces of active bricks

Page 26: REAL-TIME VOLUME GRAPHICS Markus Hadwiger VRVis Research Center, Vienna Eurographics 2006 Real-Time Volume Graphics [04] GPU-Based Ray-Casting

REAL-TIME VOLUME GRAPHICSMarkus HadwigerVRVis Research Center, Vienna Eurographics 2006

Virtual EndoscopyViewpoint inside the volumewith wide field of viewE.g.: virtual colonoscopy

Hybrid isosurface rendering /direct volume renderingE.g.: colon wall andstructures behind

Page 27: REAL-TIME VOLUME GRAPHICS Markus Hadwiger VRVis Research Center, Vienna Eurographics 2006 Real-Time Volume Graphics [04] GPU-Based Ray-Casting

REAL-TIME VOLUME GRAPHICSMarkus HadwigerVRVis Research Center, Vienna Eurographics 2006

Virtual ColonoscopyFirst find isosurface; then continue with DVR

Page 28: REAL-TIME VOLUME GRAPHICS Markus Hadwiger VRVis Research Center, Vienna Eurographics 2006 Real-Time Volume Graphics [04] GPU-Based Ray-Casting

REAL-TIME VOLUME GRAPHICSMarkus HadwigerVRVis Research Center, Vienna Eurographics 2006

Virtual ColonoscopyFirst find isosurface; then continue with DVR

Page 29: REAL-TIME VOLUME GRAPHICS Markus Hadwiger VRVis Research Center, Vienna Eurographics 2006 Real-Time Volume Graphics [04] GPU-Based Ray-Casting

REAL-TIME VOLUME GRAPHICSMarkus HadwigerVRVis Research Center, Vienna Eurographics 2006

Hybrid Ray-Casting (1)

Isosurface renderingFind isosurface firstSemi-transparent shading provides surface information

Additional unshaded DVRRender volume behind the surfacewith unshaded DVRIsosurface is starting positionStart with ( 1.0-iso_opacity )

Page 30: REAL-TIME VOLUME GRAPHICS Markus Hadwiger VRVis Research Center, Vienna Eurographics 2006 Real-Time Volume Graphics [04] GPU-Based Ray-Casting

REAL-TIME VOLUME GRAPHICSMarkus HadwigerVRVis Research Center, Vienna Eurographics 2006

Hybrid Ray-Casting (2)

Hiding sampling artifacts (similar to interleaved sampling, [Heidrich and Keller, 2001])

Page 31: REAL-TIME VOLUME GRAPHICS Markus Hadwiger VRVis Research Center, Vienna Eurographics 2006 Real-Time Volume Graphics [04] GPU-Based Ray-Casting

REAL-TIME VOLUME GRAPHICSMarkus HadwigerVRVis Research Center, Vienna Eurographics 2006

Conclusions

GPU ray-casting is an attractive alternativeVery flexible and easy to implementFragment shader conditionals are very powerful; performance pitfalls very likely to go awayMixing image-order and object-order well suited to GPUs (vertex and fragment processing!)Deferred shading allows complex filtering and shading at high frame rates

Page 32: REAL-TIME VOLUME GRAPHICS Markus Hadwiger VRVis Research Center, Vienna Eurographics 2006 Real-Time Volume Graphics [04] GPU-Based Ray-Casting

REAL-TIME VOLUME GRAPHICSMarkus HadwigerVRVis Research Center, Vienna Eurographics 2006

Thank You!

AcknowledgmentsHenning Scharsach, Christian Sigg, Daniel WeiskopfVRVis is funded by the Kplus program of the Austrian government