Date post: | 29-Dec-2015 |
Category: |
Documents |
Upload: | kathleen-atkins |
View: | 215 times |
Download: | 0 times |
Optical Models
Jian Huang, CS 594, Spring 2002
This set of slides are modified from slides used by Prof. Torsten Moeller, at Simon Fraser University, BC, Canada.
Optical Models
• Nelson Max, “Optical Models”, IEEE Transactions on Visualization and Computer Graphics, Vol. 1, No. 2, 1995.
• Jim Blinn’s 1982 SIGGRAPH paper on scattering.
• The mathematical framework for light transport in volume rendering.
Transport of Light• Determination of Intensity• Local - Diffuse and Specular• Global - Radiosity, Ray Tracing, Ultimate
Physcial• Mechanisms in Ultimate Model
– Emittance (+)
– Absorption (-)
– Scattering (+) (single vs. multiple)
Light
Observer
Transport of Light• Typically based on - S. Chandrasekhar “Radiative
Transfer”, Oxford Universtiy Press 1950• Mathematically challenging • Approximate models required -
Blinn et al to the rescue• Over Operator -
only emission and absorption
Light
Observer
Max - 1995
• Several cases:– Completely opaque or transparent voxels
– Variable opacity correction
– Self-emitting glow
– Self-emitting glow with opacity along viewing ray
– Single scattering of external illumination
– Multiple scattering
Blinn - Assumptions
• Assumptions:– N - surface normal
– E - eye vector
– L - light vector
– T - surface thickness
– e - angle btw. E and N
– a - angle btw. E and Laka phase angle
– I - angle btw. N and L
a
LE
N
ei
Particles
T
Blinn - Assumptions
• Assumptions (contd.):– particles are little spheres with
radius p
– n - number density (number of particles per unit volume)
– - cosine of angle e, i.e. N.E
– D - proportional volume of the cloud occupied by particles
a
LE
N
ei
Particles
T
3
3
4pnD
Blinn – transparency (1)
• Expected particles in a volume will be nV
• Probability that there are no particles in the way can be modeled as a Poisson process:
• Hence the probability that the light is making it through those tubes is:
E L
t
Cylindersmust be empty
nVeVP ,0
E
L
Cylindersof Integration
t
Bottom Lit
Top Lit
TpnTpn
eeVP
2
0
2
,0
Blinn – transparency (2)
• Transparency through the cloud:
• is called the optical depth
eTrE
-E
Tpn 2
T
Max - absorption only
• I(s) = intensity at distance s along a ray• (s) = extinction coefficient
• T(s) = transparency between 0 and s
sIsds
dI
sTI
dttIsIs
0
0
exp0
Max - absorption only
• Linear variation of
2
0exp
exp0
DD
dttsTD
t
D
D)
0)
Max - absorption only
• On the opacity
• assuming to be constant in the interval
...2/
exp1
exp11
2
0
DD
D
dttsTD
Max - cloud model
• Using fractal structure (Perlin)
Max - self-emitting glow
• Without extinction:
sgds
dI
s
dttgIsI0
0
Max - self-emitting glow
• Without extinction:
Max - self-emitting glow
• With extinction:
sIssgds
dI
dsdttsgdttIDID D
s
D
00
0 expexp
dssTsgDTIDID
0
0
• The continuous form:
• In general case, can not compute analytically
dsdttsgdttIDID D
s
D
00
0 expexp
Volume Ray Integral (1)
Volume Ray Integration (2)• Practical Computation Method:
» note: x can be xi (different everywhere)
– which leads to the familiar BTF or FTB compositing …
dsdttsgdttIDID D
s
D
00
0 expexp
xxixxiti 1exp
011211
1 110
Itggtgtg
gttIDI
nnnnn
n
ii
n
ijj
n
ii
g(s)
• g(s) could be:– Self-emitting particle glow– Reflected color, obtained via illumination
• The color is usually the sum of emitted color E and reflected color R
Max - self-emitting glow
• Identical glowing spherical particles:• projected area a = r2
• surface glow color = C• number per unit volume = N•
• extinction coefficient = a N• added glow intensity per unit length
g = C a N = C
A
aNAdl
area total
area occluded
dl
A
Max - self-emitting glow
• Special Case g=C: (and C constant)
• This is compositing color C on top of background I0
DTCDTIDI 10
D
D D
s
D D
s
dttC
dsdttsCdsdttsg
0
00
exp1
expexp
Max - self-emitting glow
• For I0=0 and : varying according to f:
Volume Ray Integration Equation
• Self-emitting glow, none constant color
dsdttssCdsdttsgD D
s
D D
s
00
exp)(exp
Max - reflection
• i(x) = illumination reaching point x• = unit reflection direction vector• ’ = unit illumination direction vector• r(x,,’): BRDF
– for conventional surface shading effects
xixrxg ,,
xf
O
X
Max - reflection
• For particle densities:
– w(x) = albedo• Blinn: assuming that the primary effect is from interaction of light
with one single particle
• albedo - proportion of light reflected from a particle: in the range of 0..1
– p(,’) = phase function
• still unrealistic external reflection of outside illumination
,,, pxxwxr
O
X
Blinn - Phase Function
• “how” we see theparticles
• depends on the angle ofeye E and light vector L
• smooth drop off …
L E
L
E
L
E
a = 0
a = 90
a = 180
Top View EyeView
a0 180
a
Blinn - Phase Function
• Many different models possible• Constant function
– size of particles much less then wavelength of the light
• Anisotropic– more light forward then backward - essentially our
diffuse shading
• Lambert surfaces– spheres reflect according to Lamberts law– physically based
1 a
axa cos1
aaaa cossin38
Blinn - Phase Function
• Rayleigh Scattering– diffraction effects dominate
• Henyey-Greenstein– general model with good fit to empirical data
• Empirical Measurments– tabulated phase function
• sums of functions– weighted sum of functions - model different effects in
parallel
aa 2cos143
23
22 cos211 aggga
Max - shadows
• Should account for transparency of volume between light source and point x:
• those are the “shadow feelers”• e.g. Kajiya’s two pass algorithm
0
exp, dttxLxi
O
X
Max - shadows
Max - multiple scattering
• I(x,): intensity at position x in direction • g(x,): source term (glow at x in direction )
dxIxrxg ,,,,4
dssTdxIsxr
DTDxIxID
0 4
0
,,,
,,
KIII 0
Max - multiple scattering
• use radiosity ideas for the solution• simplified model - scattering is isotropic• i.e. g(x,) does not depend on :• then we can compute the total contribution of all
voxels to the iso-tropic scattering:
• where Fij are the “form factors” and ai are the albedo coefficients
• do a first pass like Kayija and collect external illumination in E(xi)
jj
ijii xgFxaxS
Max - multiple scattering
• Results in big equation system
• we still need to solve the form factors• use an iterative solution method as in progressive
radiosity
jj
ijiii xgFxaxExg
03
02
00
0000
00
0
IKIKKII
KIIIKIKI
KIIKI
KIII
Max - multiple scattering
• Different approach: Monte Carlo Method
• Trace a large representative selection of rays from light sources and absorb them, with probability proportional to , or scatter them, with probability proportional to r. Build up the distribution of light flux flowing through each voxel (in each direction).
Max - multiple scattering
• In a view dependent rendering pass, do a final single scatter of this light distribution towards the eye:
dssTdxIsxr
DTDxIID
0 4
0
,,,
,,viewpoint
Max - multiple scattering
• albedo = 0.99• 15 iterations were needed• cloud on a 24x24x18 volume• each iteration took
15 minutes• final 512x384
rendering took5 minutes
Volumetric Ray Integration
color
opacity
object (color, opacity)
1.0
Ray-casting - revisited
color c = c s s(1 - ) + c
opacity = s (1 - ) +
1.0
object (color, opacity)
volumetric compositingInterpolationkernel
Volume Rendering Pipeline (Levoy’88)
Acquired values
Data Preparation
Prepared values
classificationshading
Voxel colors
Ray-tracing / resampling Ray-tracing / resampling
Sample colors
compositing
Voxel opacities
Sample opacities
Image Pixels
)1(
)1(
inout
inout CCC
)1(
)1(
inout
ininout CCC
Which one?
Volume Rendering Pipeline (Wittenbrink et. al. 98)
• FTB color:
• BTF color:
• Opacity:
• The colors that are composited must be pre-weighted with opacity, i.e. associate color: – C’ = C