Fast High Accuracy Volume Rendering Thesis Defense May

  • Slides: 67
Download presentation
Fast High Accuracy Volume Rendering Thesis Defense May 2004 Kenneth Moreland Ph. D. Candidate

Fast High Accuracy Volume Rendering Thesis Defense May 2004 Kenneth Moreland Ph. D. Candidate May 2004 Sandia is a multiprogram laboratory operated Sandia Corporation, a Lockheed Martin Company, Fast Highby Accuracy Volume for the United States Department of Energy’s National Nuclear Security Administration Rendering under contract DE-AC 04 -94 AL 85000.

Overview • Problem Description • Previous Work • Contributions – Adaptive Transfer Function Sampling

Overview • Problem Description • Previous Work • Contributions – Adaptive Transfer Function Sampling – Linear Luminance – Partial Pre-Integration – Linear Opacity • Results • Conclusions May 2004 Fast High Accuracy Volume Rendering 2

Overview • Problem Description • Previous Work • Contributions – Adaptive Transfer Function Sampling

Overview • Problem Description • Previous Work • Contributions – Adaptive Transfer Function Sampling – Linear Luminance – Partial Pre-Integration – Linear Opacity • Results • Conclusions May 2004 Fast High Accuracy Volume Rendering 3

Problem Description • Given: A 3 D field of scalar information, typically represented as:

Problem Description • Given: A 3 D field of scalar information, typically represented as: – A finite set of points in three space with associated scalar values. – A connectivity graph. May 2004 Fast High Accuracy Volume Rendering 4

Problem Description • Goal: Transform scalars to colors/opacities, render 3 D model. Scalars Transfer

Problem Description • Goal: Transform scalars to colors/opacities, render 3 D model. Scalars Transfer Function May 2004 Colors Opacities Fast High Accuracy Volume Rendering 5

What Is Available • Traditional/commodity 3 D graphics hardware – Fast, powerful, and now

What Is Available • Traditional/commodity 3 D graphics hardware – Fast, powerful, and now flexible. – Only (directly) support 0, 1, and 2 dimensional primitives (i. e. points, lines, and polygons). • Special purpose volume rendering hardware – Constrained functionality; rectilinear grids only. – Smaller economy of scale. • Development/fabrication costs distributed less. • Longer time span between generations. May 2004 Fast High Accuracy Volume Rendering 6

Using Commodity Graphics Hardware • Naïve approach: render cell faces as translucent polygons. May

Using Commodity Graphics Hardware • Naïve approach: render cell faces as translucent polygons. May 2004 Fast High Accuracy Volume Rendering 7

Using Commodity Graphics Hardware • Naïve approach: render cell faces as translucent polygons. •

Using Commodity Graphics Hardware • Naïve approach: render cell faces as translucent polygons. • Result: “unrealistic” hollow cells. May 2004 Fast High Accuracy Volume Rendering 8

Why is it Wrong? • 2 D polygons only capture surfaces. – Volumes absorb/emit

Why is it Wrong? • 2 D polygons only capture surfaces. – Volumes absorb/emit light differently. May 2004 Fast High Accuracy Volume Rendering 9

Overview • Problem Description • Previous Work • Contributions – Adaptive Transfer Function Sampling

Overview • Problem Description • Previous Work • Contributions – Adaptive Transfer Function Sampling – Linear Luminance – Partial Pre-Integration – Linear Opacity • Results • Conclusions May 2004 Fast High Accuracy Volume Rendering 10

Light Transport May 2004 Fast High Accuracy Volume Rendering 11

Light Transport May 2004 Fast High Accuracy Volume Rendering 11

Light Transport May 2004 Fast High Accuracy Volume Rendering 12

Light Transport May 2004 Fast High Accuracy Volume Rendering 12

A Light Transport Model • The Particle Model – Sabella, 1988 May 2004 Fast

A Light Transport Model • The Particle Model – Sabella, 1988 May 2004 Fast High Accuracy Volume Rendering 13

A Light Transport Model • Ultimately, as light passes though a disk of size

A Light Transport Model • Ultimately, as light passes though a disk of size d, some percentage energy is absorbed, while some fixed amount is added. May 2004 Fast High Accuracy Volume Rendering 14

The Volume Rendering Equation May 2004 Fast High Accuracy Volume Rendering 15

The Volume Rendering Equation May 2004 Fast High Accuracy Volume Rendering 15

The Volume Rendering Equation • This equation must be solved for every pixel. –

The Volume Rendering Equation • This equation must be solved for every pixel. – In practice, we do piecewise integration, so we may have to solve 100’s of times or more per pixel. • Has no closed form. – Must solve for specific L and functions. May 2004 Fast High Accuracy Volume Rendering 16

Solution: Linear • We can do a first order approximation through cells with linear

Solution: Linear • We can do a first order approximation through cells with linear interpolation. • The volume rendering equation can be solved with linear functions for L and , but… May 2004 Fast High Accuracy Volume Rendering 17

Solution: Linear May 2004 Fast High Accuracy Volume Rendering 18

Solution: Linear May 2004 Fast High Accuracy Volume Rendering 18

Solution: Linear May 2004 Fast High Accuracy Volume Rendering 19

Solution: Linear May 2004 Fast High Accuracy Volume Rendering 19

Solution: Linear May 2004 Fast High Accuracy Volume Rendering 20

Solution: Linear May 2004 Fast High Accuracy Volume Rendering 20

Many Terms Solution: Linear Three Cases Numerically Unstable May 2004 Fast High Accuracy Volume

Many Terms Solution: Linear Three Cases Numerically Unstable May 2004 Fast High Accuracy Volume Rendering 21

Linear “Approximation” • Plug in average luminance and attenuation. May 2004 Fast High Accuracy

Linear “Approximation” • Plug in average luminance and attenuation. May 2004 Fast High Accuracy Volume Rendering 22

Overview • Problem Description • Previous Work • Contributions – Adaptive Transfer Function Sampling

Overview • Problem Description • Previous Work • Contributions – Adaptive Transfer Function Sampling – Linear Luminance – Partial Pre-Integration – Linear Opacity • Results • Conclusions May 2004 Fast High Accuracy Volume Rendering 23

Overview • Problem Description • Previous Work • Contributions – Adaptive Transfer Function Sampling

Overview • Problem Description • Previous Work • Contributions – Adaptive Transfer Function Sampling – Linear Luminance – Partial Pre-Integration – Linear Opacity • Results • Conclusions May 2004 Fast High Accuracy Volume Rendering 24

Transfer Function • In the real world, a cloud is parameterized with material properties

Transfer Function • In the real world, a cloud is parameterized with material properties (luminance and density). • In scientific visualization, a volume can parameterized by any number of scalars (pressure, temperature, vorticity, density, etc. ). • These scalars are mapped to material properties via a transfer function. • The scalar (f) often varies linearly, but the transfer function (TL and T ) does not. May 2004 Fast High Accuracy Volume Rendering 25

Transfer Function Sampling • We cannot solve the volume rendering integral for general transfer

Transfer Function Sampling • We cannot solve the volume rendering integral for general transfer functions, so we sample. 0 0. 5 1 0. 5 0 May 2004 1 Fast High Accuracy Volume Rendering 26

Transfer Function Sampling • We cannot solve the volume rendering integral for general transfer

Transfer Function Sampling • We cannot solve the volume rendering integral for general transfer functions, so we sample. 0 0. 5 1 0. 5 0 May 2004 1 Fast High Accuracy Volume Rendering 27

Transfer Function Sampling • We cannot solve the volume rendering integral for general transfer

Transfer Function Sampling • We cannot solve the volume rendering integral for general transfer functions, so we sample. 0 0. 5 1 0. 5 0 May 2004 (0. 5) 1 Fast High Accuracy Volume Rendering 28

Transfer Function Sampling • We cannot solve the volume rendering integral for general transfer

Transfer Function Sampling • We cannot solve the volume rendering integral for general transfer functions, so we sample. 0 0. 5 1 0. 5 0 May 2004 (0. 5) 0. 5 1 0 Fast High Accuracy Volume Rendering 1 (0. 5) 29

Transfer Function Aliasing May 2004 Fast High Accuracy Volume Rendering 30

Transfer Function Aliasing May 2004 Fast High Accuracy Volume Rendering 30

Adaptive Transfer Function Sampling • Constrain the transfer function to be piecewise linear [Williams

Adaptive Transfer Function Sampling • Constrain the transfer function to be piecewise linear [Williams 98]. • The function has linear segments joined at control points. • Between the control points, the properties change linearly. May 2004 Fast High Accuracy Volume Rendering 31

Adaptive Transfer Function Sampling • If none of the scalars in a cell are

Adaptive Transfer Function Sampling • If none of the scalars in a cell are a control point of the transfer function, then the transfer function varies linearly. • Solution: clip cells at control points. – When the scalars vary linearly, the locus of points for a given scalar is a plane. • Rather than clip cells geometrically, clip ray fragments. May 2004 Fast High Accuracy Volume Rendering 32

Adaptive Transfer Function Sampling • Clipping parameters can be determined from the surface scalars

Adaptive Transfer Function Sampling • Clipping parameters can be determined from the surface scalars relative to the isosurface scalar. May 2004 Fast High Accuracy Volume Rendering 33

Overview • Problem Description • Previous Work • Contributions – Adaptive Transfer Function Sampling

Overview • Problem Description • Previous Work • Contributions – Adaptive Transfer Function Sampling – Linear Luminance – Partial Pre-Integration – Linear Opacity • Results • Conclusions May 2004 Fast High Accuracy Volume Rendering 34

Linear Luminance • A common approach for finding a closed form for the volume

Linear Luminance • A common approach for finding a closed form for the volume rendering integral [Max 90, Shirley 90] is to hold the luminance constant. • This simplifies the equation, but introduces error in the color. • Instead, let us analyze the volume rendering integral with linearly varying luminance. May 2004 Fast High Accuracy Volume Rendering 35

Linear Luminance May 2004 Fast High Accuracy Volume Rendering 36

Linear Luminance May 2004 Fast High Accuracy Volume Rendering 36

Linear Luminance • After lots of calculus… May 2004 Fast High Accuracy Volume Rendering

Linear Luminance • After lots of calculus… May 2004 Fast High Accuracy Volume Rendering 37

Linear Luminance • After lots of calculus… Notice the Repetition May 2004 Fast High

Linear Luminance • After lots of calculus… Notice the Repetition May 2004 Fast High Accuracy Volume Rendering 38

Substitute Let • Now we just need to solve for and . May 2004

Substitute Let • Now we just need to solve for and . May 2004 Fast High Accuracy Volume Rendering 39

Overview • Problem Description • Previous Work • Contributions – Adaptive Transfer Function Sampling

Overview • Problem Description • Previous Work • Contributions – Adaptive Transfer Function Sampling – Linear Luminance – Partial Pre-Integration – Linear Opacity • Results • Conclusions May 2004 Fast High Accuracy Volume Rendering 40

 , linear • Easy enough to solve. – Not too bad to compute.

, linear • Easy enough to solve. – Not too bad to compute. May 2004 Fast High Accuracy Volume Rendering 41

 , linear • Not so easy to solve/compute. • But, we can build

, linear • Not so easy to solve/compute. • But, we can build a 3 D table. – Calculate values for all applicable (D, b, f) triples. May 2004 Fast High Accuracy Volume Rendering 42

Smaller Tables • 3 D tables work, but – take lots of space –

Smaller Tables • 3 D tables work, but – take lots of space – are not very cache coherent • We could afford much more fidelity in a 2 D table. • Consider what happens when we change the limits of the integrals to range from 0 to 1. May 2004 Fast High Accuracy Volume Rendering 43

Smaller Tables • Next, we distribute D within the inner integral. • Notice that

Smaller Tables • Next, we distribute D within the inner integral. • Notice that this is an algebraic manipulation, not an approximation. May 2004 Fast High Accuracy Volume Rendering 44

Partial Pre-Integration • Because part of the equation is stored in a table, I

Partial Pre-Integration • Because part of the equation is stored in a table, I dub this technique partial pre-integration. Problem: The domain is infinite. goes to zero as b. D or f. D goes to , but not fast enough. May 2004 Fast High Accuracy Volume Rendering 45

Partial Pre-Integration • Solution: change the variables used to index . May 2004 Fast

Partial Pre-Integration • Solution: change the variables used to index . May 2004 Fast High Accuracy Volume Rendering 46

Partial Pre-Integration Average Partial Pre-Integration [Williams 98] May 2004 Fast High Accuracy Volume Rendering

Partial Pre-Integration Average Partial Pre-Integration [Williams 98] May 2004 Fast High Accuracy Volume Rendering 47

Overview • Problem Description • Previous Work • Contributions – Adaptive Transfer Function Sampling

Overview • Problem Description • Previous Work • Contributions – Adaptive Transfer Function Sampling – Linear Luminance – Partial Pre-Integration – Linear Opacity • Results • Conclusions May 2004 Fast High Accuracy Volume Rendering 48

Linear Attenuation is Not Always Best • A user-intuitive transfer function editor presents opacity

Linear Attenuation is Not Always Best • A user-intuitive transfer function editor presents opacity in the range from completely transparent to completely opaque. – But attenuation ranges from 0 to infinity. • It also allows the user to vary the visible opacity linearly. – But linear changes in attenuation result in exponential changes in visible opacity. May 2004 Fast High Accuracy Volume Rendering 49

Attenuation versus Opacity • Attenuation relates to the density of the volume. • Opacity

Attenuation versus Opacity • Attenuation relates to the density of the volume. • Opacity is the fraction of light the volume occludes. • The relationship between the two [Wilhelms 91]: May 2004 Fast High Accuracy Volume Rendering 50

 , linear • Solving results in an unwieldy equation. • Rather than try

, linear • Solving results in an unwieldy equation. • Rather than try to compute , use approximation. May 2004 Fast High Accuracy Volume Rendering 51

 , linear • That’s really close, but there is a tapering at the

, linear • That’s really close, but there is a tapering at the corners. • A cross section reveals a parabola-like structure. • Fit a parabola to it to get really close. May 2004 Fast High Accuracy Volume Rendering 52

 , linear • with linear has no closed form. • Approximate with average

, linear • with linear has no closed form. • Approximate with average . May 2004 Fast High Accuracy Volume Rendering 53

 , linear • That’s good, but we can do better. • If f

, linear • That’s good, but we can do better. • If f is greater than b, should be smaller. – Weight accordingly. May 2004 Fast High Accuracy Volume Rendering 54

Linear Approximations Average Initial Approx Improved Approx May 2004 Fast High Accuracy Volume Rendering

Linear Approximations Average Initial Approx Improved Approx May 2004 Fast High Accuracy Volume Rendering 55

Overview • Problem Description • Previous Work • Contributions – Adaptive Transfer Function Sampling

Overview • Problem Description • Previous Work • Contributions – Adaptive Transfer Function Sampling – Linear Luminance – Partial Pre-Integration – Linear Opacity • Results • Conclusions May 2004 Fast High Accuracy Volume Rendering 56

Results, Speed May 2004 Fast High Accuracy Volume Rendering 57

Results, Speed May 2004 Fast High Accuracy Volume Rendering 57

Results, Accuracy D = 0. 001 D = 0. 1 D=1 Average May 2004

Results, Accuracy D = 0. 001 D = 0. 1 D=1 Average May 2004 Partial Pre-Integration Fast High Accuracy Volume Rendering [Williams 98] 58

Results, Accuracy D = 0. 001 D = 0. 1 D=1 Average May 2004

Results, Accuracy D = 0. 001 D = 0. 1 D=1 Average May 2004 Approx 1 Fast High Accuracy Volume Rendering Approx 2 59

Spatial Visualization • Uniform errors are unlikely to make a difference in visual perception.

Spatial Visualization • Uniform errors are unlikely to make a difference in visual perception. May 2004 Fast High Accuracy Volume Rendering 60

Spatial Visualization • Spatial transitions in color are very noticeable. -+-+-+- May 2004 Fast

Spatial Visualization • Spatial transitions in color are very noticeable. -+-+-+- May 2004 Fast High Accuracy Volume Rendering 61

Cell Boundaries • At cell boundaries, approximation errors can change when the color does

Cell Boundaries • At cell boundaries, approximation errors can change when the color does not. May 2004 Fast High Accuracy Volume Rendering 62

Back Lit Back Opaque Uniform Luminance Uniform Attenuation Results, Cell Boundaries Front Opaque Front

Back Lit Back Opaque Uniform Luminance Uniform Attenuation Results, Cell Boundaries Front Opaque Front Lit Average May 2004 Partial Pre-Integration Fast High Accuracy Volume Rendering [Williams 98] 63

Back Lit Back Opaque Uniform Luminance Uniform Attenuation Results, Cell Boundaries Front Opaque Front

Back Lit Back Opaque Uniform Luminance Uniform Attenuation Results, Cell Boundaries Front Opaque Front Lit Average May 2004 Approx 1 Fast High Accuracy Volume Rendering Approx 2 64

Overview • Problem Description • Previous Work • Contributions – Adaptive Transfer Function Sampling

Overview • Problem Description • Previous Work • Contributions – Adaptive Transfer Function Sampling – Linear Luminance – Partial Pre-Integration – Linear Opacity • Results • Conclusions May 2004 Fast High Accuracy Volume Rendering 65

Conclusions • Adaptive transfer function sampling functional but slower than expected. – Due to

Conclusions • Adaptive transfer function sampling functional but slower than expected. – Due to heavy reliance on fragment processor. – Still competitive with other rendering solutions. • Partial pre-integration works well. – Visually indistinguishable from [Williams 98]. – Over 10 X faster. • Approximations for linear opacity work well. – Nearly as fast as [Wilhelms 91]. – No visual artifacts. May 2004 Fast High Accuracy Volume Rendering 66

fin May 2004 Fast High Accuracy Volume Rendering 67

fin May 2004 Fast High Accuracy Volume Rendering 67