Professional Documents
Culture Documents
Rendering (DVR):
Ray-casting
Mengxia Zhu
Fall 2007
Light: bouncing photons
Lights send off photons in all directions
Model these as particles that bounce off objects in the scene
Each photon has a wavelength and energy (color and
intensity)
When photon bounce, some energy is absorbed, some
reflected, some transmitted
If we can model photon bounces we can generate
image
Techniques: follow each photon from the light source
until
All of its energy is absorbed (after too many bounces)
It departs the known universe
It strikes the image and its contribution is added to
appropriate pixel
Forward Ray Tracing
Rays are the path of these photons
This method of rendering by following photon path is
called ray tracing
Forward ray tracing follows the photon in direction that
light travels (from the source)
Big problem with this approach:
Only a tiny fraction of rays will reach the image
Extremely slow
Ideal Scenario:
We’d like to magically know which rays will eventually
contribute to the image, and trace only those
N x 2D arraies = 3D array
Data Representation (2)
What is a Voxel? – Two definitions
popular filters are: nearest neighbor (box), trilinear (tent), Gaussian, cubic
spline
c1
c2
c3
Raycasting
volumetric compositing
color
opacity
1.0
color
opacity
1.0
color c = c s s(1 - ) + c
opacity = s (1 - ) +
1.0
color
opacity
1.0
color
opacity
1.0
color
opacity
1.0
color
opacity
1.0
color
opacity
image pixel
viewing ray
trilinear
interpolation
voxel
sample point
Classification/Transfer Function
Maps raw voxel value into presentable entities:
color, intensity, opacity, etc.
Raw-data material (R, G, B, , Ka, Kd, Ks, .)
Front-to-back C cs s (1 ) C
s (1 )
Advantage: early ray termination
back-to-front
C C (1 s ) cs
(1 s ) s
Advantage: object approach suitable for hardware implementation
Ray Traversal Schemes
Intensity
Max
Average
Accumulate
First
Depth
Ray Traversal - First
Intensity
First
Depth
Ray Traversal - Average
Intensity
Average
Depth
Average: produces basically an X-ray picture
Ray Traversal - MIP
Intensity
Max
Depth
Max: Maximum Intensity Projection
used for Magnetic Resonance Angiogram
Ray Traversal - Accumulate
Intensity
Accumulate
Depth
Accumulate opacity while compositing colors: make
transparent layers visible!
Levoy ‘88
Volume Rendering Pipeline
Acquired values
Data preparation
Prepared values
shading classification
Voxel colors Voxel opacities
Image Pixels
VTK Ray Casting Example
The given data represents a mummy
preserved for a long time. So the skin is
dried and not very crisp when compared
to the data set given in Project 3.
The dried skins iso value was found to
be around 70 to 90. The skull iso value
was around 100 to 120. In order to
visualize this data set a opacity transfer
function and a color transfer function are
constructed. The opacity for values
ranging from 0 - 50 is chosen to be 0.0
and 55 - 80 is chosen to be 0.1 (semi
translucent) and finally the bone values
ranging from 90 - 120 is given a complete
opaque value of 1.0. The colors are
chosen in such a way that the skin range
has a light blue and the bone has a
complete white and all other values have
a color value of 0.0.
www.cs.utah.edu/.../sci_vis/prj4/REPO
RT.html
VTK Ray Casting Example
create the maximum
intensity projection of the
image. This looks more
like an x-ray of the
mummy. I used the inbuilt
method in VTK called
vtkVolumeRayCastMIPFun
ction . The opacity transfer
function plays a major role
in this technique and the
color transfer function is
used to adjust the contrast
and get good looking
images.
www.cs.utah.edu/.../sci_v
is/prj4/REPORT.html
Adaptive Termination