generalization to 3d - faculty.jacobs-university.de filegeneralization to 3d • we can still...
TRANSCRIPT
320322: Graphics and Visualization 763
Visualization and Computer Graphics LabJacobs University
Generalization to 3D
• Coming back to our original problem of extractingisosurfaces, we can apply the idea of the marchingsquares algorithm to volumetric cells.
• We still compute the intersection of edges with theisocontour (now isosurface).
• The intersection points on the edges are obtained as a linear combination as before.
• The intersection points are connected by triangles.• Connectivity becomes more complicated.
320322: Graphics and Visualization 764
Visualization and Computer Graphics LabJacobs University
Generalization to 3D
• We can still establish a case table with all thepossible configuration for inside/outside-properties.
• As each cell has 8 vertices, we obtain 28 = 256 cases.• The cells are cubes (or cuboids).• Hence, the 3D algorithm is called Marching Cubes.
320322: Graphics and Visualization 765
Visualization and Computer Graphics LabJacobs University
Example cases
• Due to (rotational and inside-outside) symmetries, wecan reduce the case table from 256 cases to 15 cases.
320322: Graphics and Visualization 766
Visualization and Computer Graphics LabJacobs University
Reduced marching cubes case table
320322: Graphics and Visualization 767
Visualization and Computer Graphics LabJacobs University
Ambiguous faces
• Do ambiguous faces occur?
• Yes, in 6 of the 15 reduced cases.• Solution: Use asymptotic decider on each ambiguous
face.
320322: Graphics and Visualization 768
Visualization and Computer Graphics LabJacobs University
Ambiguous faces
• If we want to have a fast solution, can we just pick anyof the two choices?
• One has to make sure that the picking is doneconsistently such that a manifold surface is generated.
• This can be achieved using a case table with 256 cases.
320322: Graphics and Visualization 769
Visualization and Computer Graphics LabJacobs University
Ambiguous cells
• Is there also something like an ambiguous cell?
No ambiguous face Still, there is a second possibility
This is called a tunnel case
320322: Graphics and Visualization 770
Visualization and Computer Graphics LabJacobs University
Tunnel case
320322: Graphics and Visualization 771
Visualization and Computer Graphics LabJacobs University
3D asymptotic decider
• The same observation as in 2D can be done in 3D using a trilinear interpolation within the cube.
• One computes the intersection of the asymptotes of the hyperboloid and evaluates the function valuethere.
• Then, the analogous decision can be made.
320322: Graphics and Visualization 772
Visualization and Computer Graphics LabJacobs University
Marching Cubes
320322: Graphics and Visualization 773
Visualization and Computer Graphics LabJacobs University
9.3 Direct Volume Rendering
320322: Graphics and Visualization 774
Visualization and Computer Graphics LabJacobs University
Direct volume rendering
• Direct volume rendering is an alternative to surfaceextraction for visualizing volumetric shapes.
• Direct volume rendering does not extract anygeometry but directly displays the visible volumefrom a given viewpoint.
• This saves the surface extraction step.• On the other hand, it is view-dependent, i.e., the
entire computation needs to be executed again aftereach transformation step.
320322: Graphics and Visualization 775
Visualization and Computer Graphics LabJacobs University
Generalization of color mapping
• Direct volume rendering can be regarded as a generalization of color mapping.
• Again, the range of the scalar field f is mapped to color values.
• However, now it is done for all the samples within thevolume.
• In order to decide, what parts of the volume arevisible, we also need to assign opacities.
• Hence, the color mapping is extended from the rangeof f to RGBA values.
320322: Graphics and Visualization 776
Visualization and Computer Graphics LabJacobs University
Approach
• Feature extraction:Define opaque (and semi-transparent) regions.
• Displaying the feature:Render the opaque regions visible from the viewpoint.
• Interaction:Allow for viewing transformations and for changingthe color mapping (including opacity values).
320322: Graphics and Visualization 777
Visualization and Computer Graphics LabJacobs University
Ray casting
• The most famous direct volume rendering approach isobtained by casting rays to the viewpoint through anypixel of the viewing plane:
viewerviewing plane
bounding box of volume
ray
pixel
320322: Graphics and Visualization 778
Visualization and Computer Graphics LabJacobs University
Ray casting
• Light with intensity I0 enters the volume at some entry point.• The light traverses the volume and loses intensities depending
on the property of the traversed medium.• The denser the medium, the more light is absorbed.• Density is regulated using the assigned opacities.• The light that exits the volume is what is observed by the
viewer.
viewerviewing plane
bounding box of volume
ray
pixel
light I0
entry into volumeexit from volume
320322: Graphics and Visualization 779
Visualization and Computer Graphics LabJacobs University
Ray casting
• In order to determine, how much light arrives on a point on the ray, one needs to integrate the light attenuation from the entry into the volume (position0 on the ray) to the current position L.
light I0
320322: Graphics and Visualization 780
Visualization and Computer Graphics LabJacobs University
Ray casting• The attenuation is described by an exponential
decrease.• Hence, the intensity I(L) at distance L from the ray‘s
entry into the volume is described by
where μ(t) describes the density at position t alongthe ray.
I0I(L)
320322: Graphics and Visualization 781
Visualization and Computer Graphics LabJacobs University
Ray casting
• The attenuation term comprises light absorption and light scattering.
• For light scattering, light is not absorbed but deflected.• On the other hand, light that arrives the ray at position
L from a different direction, may be reflected into thedirection of the viewer.
320322: Graphics and Visualization 782
Visualization and Computer Graphics LabJacobs University
Ray casting
• Taking this incoming scattering effect into account, wemodify the light intensity computation at point L to
• We integrate the incoming light C(s) along the ray fromits entry s=0 to the position s=L.
• How much of the incoming light is scattered depends on the density μ(s) at position s.
• From position s to position L, the incoming scattered light C(s) μ(s) is again attenuated (exponential decrease).
320322: Graphics and Visualization 783
Visualization and Computer Graphics LabJacobs University
Ray casting
• The integral is called the volume rendering integral.• It describes the radiation transfer in translucent
materials.• I(L) for L being the length of the ray within the
volume describes the visible light that reaches theviewer along the ray.
• The light term C(s) can be generalized to cover bothincoming scattered light and emitted light, in case onewould like to model light-emitting materials.
• C(s) would be just the sum of emitted light and incoming scattered light.
320322: Graphics and Visualization 784
Visualization and Computer Graphics LabJacobs University
Discretization
• In order to approximate the volume renderingintegral, one needs to discretize it.
• We use an equidistant sampling along the ray withsampling rate ∆s.
320322: Graphics and Visualization 785
Visualization and Computer Graphics LabJacobs University
Discrete volume rendering integral
• With C(0) = I0 and μ(0)=1, we obtain the discreteversion of the volume rendering integral:
• Density μ(s) has been replaced by opacity α(i ∆s).• For the attenuation term, we used the fact
and replaced the exponential function with its linear Taylor approximation
320322: Graphics and Visualization 786
Visualization and Computer Graphics LabJacobs University
Back-to-front compositing
• The discrete volume rendering integral can becomputed by accumulating the values at the samplepositions along the ray.
• This is a back-to-front compositing.• Starting with
C := C(0) = I0, the accumulation formula for C is given by
C := C · (1- α(i ∆s)) + C(i ∆s) · α(i ∆s)
320322: Graphics and Visualization 787
Visualization and Computer Graphics LabJacobs University
Interpolation
• The samples along the ray will, in gerenal, not coincidewith the grid points that sample our scalar field f.
• In general, the sample position will lie in the interiorof a cell.
• As for cutting planes, we determine the cell and weuse trilinear interpolation within the cell to determinethe function value at the ray sample.
320322: Graphics and Visualization 788
Visualization and Computer Graphics LabJacobs University
Transfer function
• To the interpolated function values, we assign colorand opacity values.
• The function that maps the range of function valuesto RGBA color values is called the transfer function.
• The transfer function determines the visibility and hence the display of the resulting image.
• For example, a boundary surface rendering of an object is obtained by assigning A=1 to all interiorpoints and A=0 to all exterior points.
• The light intensity integration is performed for eachcolor channel independently.
320322: Graphics and Visualization 789
Visualization and Computer Graphics LabJacobs University
Volume rendering pipeline
1. Shoot rays through all pixels to the viewpoint.2. Sample the ray within the bounding box of the
volume with a given step size.3. At each ray sample, compute the function value using
trilinear interpolation.4. Assign the transfer function to compute color and
opacity at each ray sample.5. Use back-to-front compositing to accumulate the
color intensities along the ray.6. Write the accumulated color to the pixel.
320322: Graphics and Visualization 790
Visualization and Computer Graphics LabJacobs University
Volume rendering pipeline II
1. Shoot rays through all pixels to the viewpoint.2. Sample the ray within the bounding box of the
volume with a given step size.3. Assign the transfer function to compute color and
opacity at each grid point.4. At each ray sample, compute color and opacity using
trilinear interpolation.5. Use back-to-front compositing to accumulate the
color intensities along the ray.6. Write the accumulated color to the pixel.
320322: Graphics and Visualization 791
Visualization and Computer Graphics LabJacobs University
Classification
• The process of assigning color and opacity values to function values is also referred to as classification.
• The process of interpolating function values to obtain a continuous field is also referred to as reconstruction.
• The first pipeline is referred to as post-classification, as classification is executed after reconstruction.
• The second pipeline is referred to as pre-classification, as classification is executed before reconstruction.
320322: Graphics and Visualization 792
Visualization and Computer Graphics LabJacobs University
Surface rendering
320322: Graphics and Visualization 793
Visualization and Computer Graphics LabJacobs University
Semi-transparent regions
320322: Graphics and Visualization 794
Visualization and Computer Graphics LabJacobs University
Transparent surfaces
320322: Graphics and Visualization 795
Visualization and Computer Graphics LabJacobs University
Foggy regions
320322: Graphics and Visualization 796
Visualization and Computer Graphics LabJacobs University
Foggy regions
320322: Graphics and Visualization 797
Visualization and Computer Graphics LabJacobs University
Pre- vs. post-classification
• Pre- and post-classification are, in general, notproducing the same result.
• Classification and reconstruction are onlycommutative, if the transfer function is linear.
• Pre-classification can lead to less crisp images whenthe transfer function has fine details.
• Post-classification can lead to false colors wheninterpolating function values across discontinuities.
320322: Graphics and Visualization 798
Visualization and Computer Graphics LabJacobs University
Pre- vs. post-classification
320322: Graphics and Visualization 799
Visualization and Computer Graphics LabJacobs University
Pre- vs. post-classification