Volumes and Participating Media

Participating Media & Vol. Scattering
Applications
Clouds, smoke, water, …
Subsurface scattering: paint, skin, …
Scientific/medical visualization: CT, MRI, …
Topics
Absorption and emission
Scattering and phase functions
Volume rendering equation
Homogeneous media
Ray tracing volumes
University of Texas at Austin CS395T - Advanced Image Synthesis
Spring 2007 Don Fussell
Absorption
L ( x,  )
L  dL
 a ( x)
ds
dL( x,  )   a ( x )L( x,  ) ds
Absorption cross-section:
 a ( x)
Probability of being absorbed per unit length
University of Texas at Austin CS395T - Advanced Image Synthesis
Spring 2007 Don Fussell
Transmittance
dL( x,  )   a ( x )L( x,  ) ds
dL( x,  )
  a ( x ) ds
L ( x,  )
s
ln L( x  s  ,  )     a ( x  s )ds   (s)
0
Optical distance or depth
s
 (s)    a ( x  s ) ds
0
Homogenous media: constant
a
 a   (s )   a s
University of Texas at Austin CS395T - Advanced Image Synthesis
Spring 2007 Don Fussell
Transmittance and Opacity
dL( x,  )   a ( x )L( x,  ) ds
dL( x,  )
  a ( x ) ds
L ( x,  )
s
ln L( x  s  ,  )     a ( x  s )ds   (s)
0
L( x  s  ,  )  e ( s ) L( x,  )  T (s)L( x,  )
Transmittance
T (s)  e ( s )
Opacity
 (s )  1  T (s)
University of Texas at Austin CS395T - Advanced Image Synthesis
Spring 2007 Don Fussell
Out-Scatter
L ( x,  )
 s ( x)
L  dL
ds
dL( x,  )   s ( x )L( x,  ) ds
Scattering cross-section:
s
Probability of being scattered per unit length
University of Texas at Austin CS395T - Advanced Image Synthesis
Spring 2007 Don Fussell
Extinction
L ( x,  )
 t ( x)
L  dL
ds
dL( x,  )   t ( x )L( x,  ) ds
t  a s
s
s
W

t a s
Total cross-section
Albedo
Attenuation due to both absorption and scattering
s
 (s)    t ( x  s ) ds
0
University of Texas at Austin CS395T - Advanced Image Synthesis
Spring 2007 Don Fussell
Black Clouds
From Greenler, Rainbows, halos and glories
University of Texas at Austin CS395T - Advanced Image Synthesis
Spring 2007 Don Fussell
In-Scatter
L ( x,  )
 s ( x)
L  dL
ds
S( x,  )   s ( x )  p(    ) L( x,  ) d 
S2
Phase function
p(    )
Reciprocity
p(   )  p(    )
Energy conserving
 p(    ) d   1
S2
University of Texas at Austin CS395T - Advanced Image Synthesis
Spring 2007 Don Fussell
Phase Functions
Phase angle
cos    



Phase functions (from the phase of the moon)
1
1. Isotropic
p(cos  ) 
4
-simple
2
3
1

cos

2. Rayleigh
p(cos ) 
-molecules
4
4
3. Mie scattering
- small spheres
... Huge literature ...
University of Texas at Austin CS395T - Advanced Image Synthesis
Spring 2007 Don Fussell
Blue Sky = Red Sunset
From Greenler, Rainbows, halos and glories
University of Texas at Austin CS395T - Advanced Image Synthesis
Spring 2007 Don Fussell
Coronas and Halos
Moon Corona
Sun Halos
From Greenler, Rainbows, halos and glories
University of Texas at Austin CS395T - Advanced Image Synthesis
Spring 2007 Don Fussell
Henyey-Greenstein Phase Function
Empirical phase function
g = -0.3
1
1  g2
p(cos  ) 
4 1  g 2  2 g cos  3 2


g = 0.6

2  p(cos )cos d  g
0
g: average phase angle
University of Texas at Austin CS395T - Advanced Image Synthesis
Spring 2007 Don Fussell
The Volume Rendering Equation
Integro-differential equation
L ( x,  )
  t ( x )L ( x,  )  S( x,  )
s
Integro-integral equation
s

L ( x,  )   e

  t ( x  s ) ds
0
S( x  s ) ds
0
Attenuation: Absorption and scattering
Source: Scatter (+ emission)
University of Texas at Austin CS395T - Advanced Image Synthesis
Spring 2007 Don Fussell
Simple Atmosphere Model
Assumptions
Homogenous media
Constant source term (airlight)
L (s)
  t L (s)  S
s


L ( s )  1  e   t s S  e   t sC
S
Fog
Haze
University of Texas at Austin CS395T - Advanced Image Synthesis
Spring 2007 Don Fussell
C
The Sky
From Greenler, Rainbows, halos and glories
University of Texas at Austin CS395T - Advanced Image Synthesis
Spring 2007 Don Fussell
Atmospheric Perspective
From Greenler, Rainbows, halos and glories
University of Texas at Austin CS395T - Advanced Image Synthesis
Spring 2007 Don Fussell
Atmospheric Perspective
Aerial Perspective: loss of contrast and change in color
From Musgrave
University of Texas at Austin CS395T - Advanced Image Synthesis
Spring 2007 Don Fussell
Semi-Infinite Homogenous Media
cos  i
Reduced Intensity
coso
L( z, i )  e ( z,i ) L(0, i )
Effective source term
S( z, o )   s p(i  o )e ( z,i ) L(0,i )
Volume rendering equation
L( z, o )
coso
  t L( z, o )  S( z, o )
z
z  s cos
dz  ds cos
Integrating over depths

coso L(o )   e t z / coso s p(i , o )e  t z / cosi L(i ) dz
0
University of Texas at Austin CS395T - Advanced Image Synthesis
Spring 2007 Don Fussell
Semi-Infinite Homogenous Media
cos  i
Integrating over depths

coso
cos o L (o )   e  t z / coso s p(i ,  o )e  t z / cosi L (i ) dz
0

  s p(i ,  o ) L (i )  e
 1
1 
 t 

z
cos

cos

i
o

dz
0
  s p(i ,  o ) L (i )
1
 1
1 
t 


cos

cos

i
o

cos i cos  o
 W p(i ,  o ) L (i )
cos i  cos  o
University of Texas at Austin CS395T - Advanced Image Synthesis
Spring 2007 Don Fussell
Semi-Infinite Homogenous Media
BRDF
cos  i coso
L (i ,  o )
dL
fr (i ,  o ) 

dE L (i ) cos  i
1
 W p(i ,  o )
cos  i  cos  o
Lommel-Seeliger Law for Diffuse Reflection
University of Texas at Austin CS395T - Advanced Image Synthesis
Spring 2007 Don Fussell
Subsurface Scattering
Skin
University of Texas at Austin CS395T - Advanced Image Synthesis
Spring 2007 Don Fussell
Volume Representations
3D arrays (uniform rectangular)
CT data
3D meshes
CFD, mechanical simulation
Simple shapes with solid texture
Ellipsoidal clouds with sum-of-sines densities
Hypertexture
University of Texas at Austin CS395T - Advanced Image Synthesis
Spring 2007 Don Fussell
Scalar Volumes
sl 1
sl
Voxel
sl 1
(i , j , k )
Interpolation v(sl )  trilinear(v, i, j, k, x(sl ))
Map scalars to optical properties  s (v), a (v)
University of Texas at Austin CS395T - Advanced Image Synthesis
Spring 2007 Don Fussell
Scalar Volumes
s  ds
Ls ( xL ,  ( xL , x(s)))
s
Voxel
s  ds
(i , j , k )
S( x(s),  )   s (s) p( ,  ( x(s), xL )) Ls ( xL ,  ( xL , x(s)))
Scatter
University of Texas at Austin CS395T - Advanced Image Synthesis
Spring 2007 Don Fussell
Ray Marching
Direct Lighting
Primary ray
T 1
L0
for(s  0; s  1; s   ds)
S   s (s) p( ,  ( x (s), x L )) Ls ( x L ,  ( x L , x(s)))
L  L  T Ss
T  T 1   t ( x (s)) s
University of Texas at Austin CS395T - Advanced Image Synthesis
Spring 2007 Don Fussell
Ray Marching
Direct Lighting
Shadow ray
T 1
for(t  0; t  1; t   dt )
T  T 1   t ( x (t )) t
S( x (s))   s (s) p( ,  ( x (s), x L )) T Ls ( x L ,  ( x L , x (s)))
University of Texas at Austin CS395T - Advanced Image Synthesis
Spring 2007 Don Fussell
Beams of Light
From Greenler, Rainbows,
halos and glories
From Minneart, Color and light
in the open air
University of Texas at Austin CS395T - Advanced Image Synthesis
Spring 2007 Don Fussell
Color and Opacity Volumes
M. Levoy, Ray tracing volume densities
C (i, j, k )  ( R, G, B)
sl 1
A(i, j, k )
c(i, j, k ) 
sl
Voxel
C(i, j, k ) * A(i, j, k ), A(i, j, k ) 
sl 1
c( x(sl ))  trilinear(c, i, j, k, x(sl ))
University of Texas at Austin CS395T - Advanced Image Synthesis
Spring 2007 Don Fussell
Ray Marching
Direct Lighting
Primary ray
C  (0, 0, 0, 0)
for(s  0; s  1; s   ds )
C  C  (1   (C ))c(s )
University of Texas at Austin CS395T - Advanced Image Synthesis
Spring 2007 Don Fussell
Volume Rendering Examples
From Marc Levoy
From Karl Heinz Hoehne
University of Texas at Austin CS395T - Advanced Image Synthesis
Spring 2007 Don Fussell