CSL%20859:%20Advanced%20Computer%20Graphics - PowerPoint PPT Presentation

About This Presentation
Title:

CSL%20859:%20Advanced%20Computer%20Graphics

Description:

... ray at least once per voxel intersected. Ray Integration. x(t) : ray, ... Ray through the pixel intersects no polygon. x. y. Re-slice Volume. Solution: ... – PowerPoint PPT presentation

Number of Views:67
Avg rating:3.0/5.0
Slides: 56
Provided by: sub8
Category:

less

Transcript and Presenter's Notes

Title: CSL%20859:%20Advanced%20Computer%20Graphics


1
CSL 859 Advanced Computer Graphics
  • Dept of Computer Sc. Engg.
  • IIT Delhi

2
Volumetric Models
3
Not a Surface
4
Not a Surface
5
Volumes
  • 3D fields
  • Temperature, Pressure
  • Generally sampled
  • Constructed by Interpolation
  • Filter convolution, in general
  • Measured or Simulated
  • CT-scan, Xray
  • CFD Simulation
  • Conversion from surface (B-rep)

6
Translucence
Note b is absorbed, scatterred and
transmitted.
Color f (a, b)
Color a
Color b
f should depend on Degree of translucence
a Depth of a and b
7
Alpha Blending
f s (1-a)d
0 lt a lt 1
Color f (s, d)
f as (1-a)d
Color s
Opacity a
Color d
f ass add
8
Over Blend Operator
  • Porter Duff 84
  • Final fraction
  • aout aa ab(1- aa)
  • Final effective Color
  • cout aaCa ab(1- aa) Cb?
  • Recall pixel has aout fraction of the color
  • Cout aaCa ab(1- aa) Cb / aout

9
Order Dependent
  • d' as s (1-as) d
  • Examples aA 1, aB 0.4

A over B d' 1CA(1-1)CB
A
B
B over A d'
0.4CB(0.6)CA
A
B
10
Order Dependent
Each quad has an opacity of 0.5
11
Billboarding etc.
12
Volume Representation
  • BRDF for every point in space?
  • Sometimes only a limited information is
    available, eg, tissue density in CT scan
  • Sample Volume
  • Computable function at any required point
  • Subdivide space into a 3D grid and sample at grid
    points
  • Voxel
  • Could be a structured or unstructured grid
  • With scalar or vector data (sample) per vertex

13
Grids
Tetrahedral
Curvilinear
Tetrahedral
14
Volume Illumination
  • Layers of surfaces
  • Particles in space
  • Voxel emissions
  • Continuous model
  • Drebin 98
  • Surfaceness at every point
  • Based on differense in material densities
  • Surface normals from density gradient
  • Direct sample value -gt ColorOpacity map
  • Transfer function often domain-dependent

15
Volume Rendering Techniques
  • Iso-surface display
  • Ray-casting
  • Image-space accumulation
  • Back-to-front or Front-to-back
  • Sample Ray at many t values
  • Composite
  • Slice Projection
  • Object space accumulation
  • Splatting
  • Shear-warp factorization
  • 3D textures
  • Multiple transparent planes
  • Or some other shape
  • Particles
  • Slices

16
Slicing Planes
17
Particles
  • Depth Cues
  • Animation
  • Shape/Density

18
Iso-surfaces
  • Create boundary representation (B-rep)
  • Usually triangles
  • Render as surfaces
  • Possibly multiple translucent surfaces
  • Surfaces need to be carefully chosen
  • Large change across them

19
Iso-surfaces
  • Multiple Surfaces with varying opacity
  • Can impart thickness
  • Clipping planes

20
Marching Cubes
  • Corners of a voxel are inside or outside
  • 28 possible configurations
  • Only 15 are unique
  • Modulo reflection, rotation, inversion
  • Create triangles for each case
  • Store in a table lte1, e2, e3gt
  • Compute vertex location by interpolation

21
Ambiguity
2D Example
22
Ambiguity Resolution
  • Its an aliasing issue
  • Increase resolution
  • Make consistent with adjacent voxel
  • There may be loops
  • Separate out into more cases
  • Cube 33 Chernyaev 1995
  • Sample at the center of the voxel
  • Subdivide voxel cube into tetrahedra
  • Marching tetrahedra

23
Efficiency
  • Large number of voxels visited
  • Hierarchical structures to cull voxels
  • Span-space tree
  • Large number of triangles generated
  • Polygon simplification

24
Min-Max Kd-Trees
  • Construction
  • Root has median min value left subtree has
    smaller and right larger
  • For each sub-tree, root has median max value
  • Alternate

Livnat, Shen Johnson 1996
25
Search
  • Compare threshold (t ) with min of root cell,
  • If greater, test cell at this node, then test
    both children
  • If less, traverse left

m0
M10
M11
m21
m22
m20
m23
26
Lattice Sub-Division
  • Shen, Hansen et al. 1996
  • A range can be represented as a single point in
    the span space
  • Subdivide span space into a lattice and place
    each data cell into a lattice element

27
Lattice Sub-Division
  • Five cases
  • No intersection
  • Definite intersection
  • Test max only
  • Test min only
  • Test min and max

28
Voxel Splatting
  • Traverse voxels front to back
  • Normally one slice at a time
  • Project voxel into screen-space
  • Hexagonal foorprint in general
  • Accumulate color and opacity to covered pixels
  • Filter Kernel drops of contribution away from
    center of the voxel

29
Raycasting
Sample ray at least once per voxel intersected
30
Ray Integration
x(t) ray, parameterized by t
s(t) scalar value c(t) color emitted
light a(t) absorption coefficient
31
Discrete Ray Integration
n
i-1
C S C (1- a )
i i
0
0
D
0
C
C C (1-a ) C
i i i1
Requires back to front blending step from n-1
to 0
Alternatively Use Over operator
32
Illumination
  • Phong/Blinn Model
  • For each sample, evaluate
  • C ambient diffuse specular
  • constant I Kd (N.L) I Ks
    (N.H)n
  • I emission color at the sample
  • N normal at the sample

33
Phongs Model Applicable
C(p) Cl Ka Cl / (K1 K2 d(x))
Kd (N(p) . L Ks (N(p) . H )n
Cl color of light ka,kd,ks ambient,
diffusive, specular coefficient K1,K2
constant (used for depth attenuation) N(x)
normal at x
34
Normal Estimation
  • Compute the gradient at each corner
  • Interpolate the normal using central difference

y1
N(x,y,z) (f(x1) - f(x-1))/2,
(f(y1) - f(y-1))/2,
(f(z1) - f(z-1))/2
z1
x-1,
y-1,
z-1
x1
35
Transfer Function
  • Maps from scalar value to opacities
  • Region of interest high opaicity (more opaque)
  • Rest translucent or transparent
  • Opacity is typically specified by the user
  • Examples for computing opacity Levoy 88
  • Isosurface
  • Region boundary (e.g. between bone and fresh)

36
Transfer Function
Red
v
Green
(R, G, B, A)
v
Blue
v
Alpha
value
v
Fragment Shader
37
Draw Region of Interest
  • Goal Visualize voxels that are near a
  • selected threshold value t
  • No iso-surface extraction
  • Alpha test
  • void AlphaFunc (enum func, clampf ref )
  • Assign maximum opacity to voxels with value t
  • Construct a transition area with reducing opacity
  • Normally of constant thickness

38
Opacity Construction
Maintain a constant isosurface thickness, R
Opacity k (v-t) ?
Distance to value t is a non-local operation
involves a search
opacity a
opacity 0
39
Opacity Construction
Assuming a constant gradient, dv/dx Dv/Dx
(value change per voxel)
thickness R
opacity a value t
opacity a a (t - v(x)) / (R ?v/?x)
opacity 0 v t ?v/ ?x R
40
Texture Mapping

Single slice 2D image
Textured-mapped polygon
2D polygon
41
Volume Texture Mapping
2D Textures
Side view
42
Volume Textures
Proxy Geometry
  • Each xz slice is a texture on a proxy polygon
  • Blend polygons (traditionally back to front)

43
Changing Viewing Direction
Simply change the view matrix and re-render
Until
44
Changing View Direction
Until the view direction is near parallel to the
slice planes Ray through the pixel intersects no
polygon
45
Re-slice Volume
  • Solution
  • Re-orient the polygons
  • In general, pick orientation most perpendicular
    to the viewing direction

46
Three Textures
  • Must reorganize the input textures for different
    views
  • Pre-process and store three separate texture sets

xz slices
yz slices
xy slices
47
Texture Volume Rendering
Algorithm Disable depth test Enable
blending For (each slice from back to front)
- bind appropriate texture - Create a
quad corresponding to the slice - Assign
texture coordinates to vertices - Render
(using OpenGL alpha blending)
48
Varying Sampling Rate
d
d
d
d gt d gt d
Artifacts due to different sampling at
neighboring pixels
49
Solution
  • Insert intermediate slides to maintain the
    sampling rate

50
Slice switching
There is a sudden change of slicing direction
when the view vector transits from one major
direction to another. The change (popping
artifact) in the image intensity can be quite
visible
51
Solution
Use Image-space axis-aligned slicing plane
Modify slicing plane every frame, resulting in
small change
Must clip polygons to volume!
52
3D Texture Mapping
Input texture space is 3D Texture coordinates
(r,s) -gt (r,s,t)
(0,1,1)
(1,1,1)
(0,1,0)
(1,1,0)
(1,0,0)
(0,0,0)
53
3D Texture Mapping
  • Every point inside the volume can now be sampled
  • Interpolated from neighboring points
  • No need to ensure polygons aligned with slices
  • Slicing independent
  • No need to re-organize into separate 2D textures

54
Unstructured Grid
  • Tetrahedral Models
  • Re-Sample into a uniform grid (texture)
  • Render B-rep of each polyhedron
  • Transparent polygons
  • Ray-cast
  • Need to compute the next tetrahedron
  • Splatting
  • Ordering is expensive
  • Order per scan-line in the plane passing that
    scanline
  • Reduces to 2D sorting

55
Curvilinear Grid
  • Ordering a little simpler than unstructured grids
  • Two step warp
  • Grid points are effectively arranged into a
    3D-array
  • Inverse-map from Euclidean to grid space
  • Texture look-up
Write a Comment
User Comments (0)
About PowerShow.com