Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf ·...

50
 Introduction to Volume Rendering J. Tierny <[email protected]> Slides adapted from presentations by C. Hansen

Transcript of Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf ·...

Page 1: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Introduction to Volume Rendering

J. Tierny <[email protected]>Slides adapted from presentations by C. Hansen

Page 2: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Overview

Scalar Field Volume Rendering: Intuitive problem formulation; Applicative motivations; Limitations of Iso­surface based rendering; Direct Volume Rendering:

− Volume Ray Casting;− Splatting;− Shear Warp;− Texture Mapping, etc.

Page 3: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Intuitive Problem Formulation

Mimic Superman's SuperVision: Represent in an intelligible manner the interior of a 

scalar volume.

Page 4: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Applicative Motivations

Visualization of Measured 3D Data: Computed Tomography; Magnetic Resonance Field; Ultrasound, etc.

Page 5: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Applicative Motivations

Visualization of Simulated 3D Data: Fluid dynamics; Pressure; Porosity; etc.

Page 6: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Isosurface Based Rendering

Level set: L(w) = { p ∈ �, f(p) = w} 2D: isocurves 3D: isosurfaces

Seed sets + marching;

Specific blendings.

Page 7: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Isosurface limitations

No view­dependency; Boundary representations only:

May be suited for particular data­sets (CT scans); But not always appropriate (ex: fire simulation).

Isosurface Volume RenderingSlice

Page 8: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Key Idea of Volume Rendering

Every voxel should contribute to the image;

Greater flexibility; Integrate blending.

Page 9: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Volumetric Mesh + Scalar Field Volumetric Mesh + Scalar Field

Triangle Mesh + Scalar Field

Rendered Image

Isosurface Extraction

Surface Rendering

Rendered Image

Volume Rendering

Pipelines: Isosurfaces VS Vol. Rend.

Page 10: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Pipelines: Isosurfaces VS Vol. Rend.

Volumetric Mesh + Scalar Field Volumetric Mesh + Scalar Field

Triangle Mesh + Scalar Field

Rendered Image

Isosurface Extraction

Surface Rendering

Rendered Image

Volume Rendering

Standard OpenGL operations:

 Shading; Lighting; Alpha­blending; etc.

Page 11: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

What does Volume Rendering refer to? Any rendering process which:

Maps from a volume data­set; To a rendered image; Without intermediary geometry (no isosurface).

How does it work?

1) Define “rules” for color and opacity;

2) Accumulation process depending on the view point.

Page 12: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Direct Volume Rendering Consider the 3D data as:

A semi­transparent medium; Light­emitting medium.

Approaches based on physical models of light (cf. Computer Graphics Illumination);

The 3D data is represented as a whole: View “all” of the inside!

Page 13: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Direct Volume Rendering: Overview

1) Transfer Function Design: Allows the user to specify “rules” for color and 

opacity.

1) Accumulation process: Volume Ray Casting; Splatting; Shear warp, Texture Mapping, etc...

Page 14: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Transfer Functions

Given a Volumetric Mesh and a Scalar Field: Provide an intuitive way to define:

− The color of a region;− Its level of opacity.

Process dependent on the Scalar Field (feature space):− For a given isovalue:

Its color; Its opacity.

Page 15: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Transfer Function Design

Key Idea: Associate distinct materials (function ranges)

to distinct properties

Page 16: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Transfer Function Design

f

Material 1

Key Idea: Associate distinct materials (function ranges)

to distinct properties

Page 17: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Transfer Function Design

f

Material 2

Key Idea: Associate distinct materials (function ranges)

to distinct properties

Page 18: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Transfer Function Design

f

Material 3

Key Idea: Associate distinct materials (function ranges)

to distinct properties

Page 19: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Transfer Function Design

f

Material 4

Key Idea: Associate distinct materials (function ranges)

to distinct properties

Page 20: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Transfer Function Examples

f

Color Opacity

Page 21: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Transfer Function Examples

f

Color Opacity

Page 22: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Transfer Function Examples

f

Color Opacity

Page 23: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Transfer Function Examples

f

Color Opacity

Page 24: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Transfer Function Examples

f

Color Opacity

Page 25: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

From A User Perspective Finding the “right” transfer function can be hard:

Experienced users; A priori knowledge about the data­set (value isolation).

f

f

f

f

Page 26: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

From A User Perspective Semi­Automatic technique:

[BPS97]; Semi­Automatic technique:

[WDCPH07];

Page 27: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Ray Casting Overview

1) Ray Casting;

2) Sampling;

3) Shading;

4) Compositing.

Page 28: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Ray Casting

For each pixel of the screen space: Cast a ray; Direction of 

observation; Intersection problem:

− Octrees.

Page 29: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Sampling

Along each ray: Sample the data along the ray;

− Intersection with edges; Compute the function value on 

samples− Apply the appropriate interpolant;

Page 30: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Shading

For each sample: Retrieve the corresponding color; Compute the gradient of the field:

− Normal of the corresponding isosurface;

Shade the sample accordingly, given:

− The normal (gradient);− The color;− The view direction and the lights.

Page 31: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Compositing

Integrate all the contributions; Along each ray:

Go from the back to the front; At each sample:

− Retrieve the opacity value;

Composite all along.

Page 32: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Alpha­blending

OpenGL facility to blend color contributions;

The order matters! Ca = (0,0,0), a = 1;

Cb = (0,1,0), b = 0.5;

Cc = (1,1,1), c = 0.1;

Page 33: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Alpha­blending

OpenGL facility to blend color contributions;

The order matters! Ca = (0,0,0), a = 1;

Cb = (0,1,0), b = 0.5;

Cc = (1,1,1), c = 0.1;

Page 34: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Alpha­blending

OpenGL facility to blend color contributions;

The order matters! Ca = (0,0,0), a = 1;

Cb = (0,1,0), b = 0.5;

Cc = (1,1,1), c = 0.1;

Page 35: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Alpha­blending

OpenGL facility to blend color contributions;

The order matters! Ca = (0,0,0), a = 1;

Cb = (0,1,0), b = 0.5;

Cc = (1,1,1), c = 0.1;

Page 36: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Alpha­blending

OpenGL facility to blend color contributions;

The order matters! Ca = (0,0,0), a = 1;

Cb = (0,1,0), b = 0.5;

Cc = (1,1,1), c = 0.1;

Page 37: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Alpha­blending

OpenGL facility to blend color contributions;

The order matters! Ca = (0,0,0), a = 1;

Cb = (0,1,0), b = 0.5;

Cc = (1,1,1), c = 0.1;

Page 38: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Alpha­blending

OpenGL facility to blend color contributions;

The order matters! Ca = (0,0,0), a = 1;

Cb = (0,1,0), b = 0.5;

Cc = (1,1,1), c = 0.1;

C'(i) = (i)*C(i) + (1 – (i))*(i­1)*C(i­1)

'(i) = (i) + (1 ­ (i))*(i­1)

Page 39: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Compositing Schemes

Color intensity along the ray:

Depth

Color Intensity

Page 40: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Compositing Schemes

Color intensity along the ray:

Depth

First

Color Intensity

Page 41: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Compositing Schemes

Color intensity along the ray:

Depth

First

Color Intensity

Page 42: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Compositing Schemes

Color intensity along the ray:

Depth

First

Average

First

Color Intensity

Page 43: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Compositing Schemes

Color intensity along the ray:

Depth

First

Average

First

Color Intensity

Page 44: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Compositing Schemes

Color intensity along the ray:

Depth

First

Average

First

MaxMax

Color Intensity

Page 45: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Compositing Schemes

Color intensity along the ray:

Depth

First

Average

First

MaxMax

Color Intensity

Page 46: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Compositing Schemes

Color intensity along the ray:

Depth

First

Average

First

Max

Accumulate

Max

Color Intensity

Page 47: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Compositing Schemes

Color intensity along the ray:

Depth

First

Average

First

Max

Accumulate

Color Intensity

Page 48: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Compositing Along the Ray

• From Back to Front:

Eye

C(i­1), (i­1)C(i), (i)

C'(i) = (i)*C(i) + (1 – (i))*(i­1)*C(i­1)

'(i) = (i) + (1 ­ (i))*(i­1)

Page 49: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Ray Casting: Discussion

• Avantages:– Simple algorithm;

– Inherently parallel;

– Can extend lighting model (diffraction);

– High quality renderings.

• Drawbacks:– SLOW!!!!

• Lots of rays;• Lots of samples;

– Dense samples;

– Not out­of­core...

Page 50: Introduction to Volume Rendering - PEQUAN Teamtierny/stuff/teaching/tierny_intro_vol_rend09.pdf · Introduction to Volume Rendering ... Standard OpenGL ... The 3D data is represented

   

Simple Optimizations

• Make the Ray Casting algorithm “Transfer Function Aware”:

– No need to cast ray or sample in regions with no visual properties;

– Segmentation of the feature space.

• Other advanced techniques...– On Thursday with Attila!