Upload
stewart-singleton
View
222
Download
0
Tags:
Embed Size (px)
Citation preview
02/25/05 © 2005 University of Wisconsin
Last Time
• Meshing
• Volume Scattering Radiometry (Adsorption and Emission)
02/25/05 © 2005 University of Wisconsin
Today
• Participating Media– Scattering theory
– Integrating Participating Media
02/25/05 © 2005 University of Wisconsin
Scattering
• Particles in the media act as little reflectors– They are too small to see, but they influence the light passing
through
• Scattering has two effects– Out-scattering: light along a line is scattered in a different direction
– In-scattering: light from some other direction is scattered into the direction of interest
• Out-scattering decreases radiance, in-scattering increases it
02/25/05 © 2005 University of Wisconsin
Scattering is Visually Important
02/25/05 © 2005 University of Wisconsin
Out-Scattering Math
• There is an out-scattering co-efficient s (p,) – The probability density that light is scattered per unit distance
– Just like absorption coefficient, but it’s not being converted, it’s being redirected
• Define attenuation coefficient: t=a+s
• Define transmittance, Tr, between two points:
,
0,
pppp
ppp
LTL
eT
r
dtt
r
d
t
02/25/05 © 2005 University of Wisconsin
Transmittance Properties
• Transmittance from a point to itself is 1
• Transmittance multiplies along a ray
– In a voxel-based volume, we can compute transmittance through each voxel and multiply to get total through volume
1
0
0,
dtt
r
teT
ppp
pppppp rrr TTT
02/25/05 © 2005 University of Wisconsin
Optical Thickness
• Define optical thickness, :
• If the medium is homogeneous, t does not depend on p– Integration is easy and we get Beer’s law
dt dtt0 , ppp
dr
teT pp
02/25/05 © 2005 University of Wisconsin
Phase Function
• We need a function that tells us what directions light gets scattered in– The participating media equivalent of the BRDF
• The phase function, p(’), gives the distribution of outgoing directions, ’, for an incoming direction, – A probability distribution, so it must be normalized over the
hemisphere: 12
S dp
02/25/05 © 2005 University of Wisconsin
In-Scattering
• The phase function tells us where light gets scattered
• To find out how much light gets scattered into a direction, integrate over all the directions it could be scattered from
2
,,S is dLp ppp
Incoming radiance
Proportion scattered into direction
Proportion scattered
02/25/05 © 2005 University of Wisconsin
Source Term
• Given the emission radiance and the phase function, we can define a source term, S– The total amount of radiance added per unit length
– Note the resemblance to the surface scattering equation
2,,,,
,,
S isve
o
dLpLS
Sdt
dL
ppppp
pp
02/25/05 © 2005 University of Wisconsin
Isotropic vs. Anisotropic Media
• A medium is isotropic if the phase function depends only on the angle between the directions, – Write p(cos)
• Most natural materials are like this, except crystal structures
• Phase functions are also reciprocal: p(’)=p(’)
02/25/05 © 2005 University of Wisconsin
Isotropic vs. Anisotropic Phase Functions
• A phase function is isotropic if it scatters equally in all directions: pisotropic(’)=const
• There is only one possible isotropic phase function– Why? What is the additional constraint on phase functions?
• Homogeneous/inhomogeneous refers to spatial variation, isotropic/anisotropic refers to directional variation
4
1isotropicp
02/25/05 © 2005 University of Wisconsin
Physically-Based Phase Functions
• Two common physically-based formulas
• Air molecules are modeled by Rayleigh scattering– Optical extinction coefficient varies with -4
– What phenomena does this explain?
• Scattering due to larger particles (dust, water droplets) is modeled with Mie scattering– Scattering depends less on wavelength, so what color is haze?
• Turbidity is a useful measurement: T=(tm+th)/tm
– tm is vertical optical thickness of molecular atmosphere
– th is vertical optical thickness of haze atmosphere
02/25/05 © 2005 University of Wisconsin
Henyey-Greenstein Function
• Single parameter, g, controls relative proportion of forward/backward scattering: g(0,1)
232
2
cos21
1
4
1:cos
gg
ggpHG
02/25/05 © 2005 University of Wisconsin
Alternatives
• Linear combination of Henyey-Greenstein– Weights must sum to 1 to keep normalized
• Schlick Approximation – Avoid 3/2 power computation
– k roughly 1.55g-.55g3
2
2
cos1
1
4
1cos
k
kpSchlick
n
iiHGi gpwp
1
:coscos
02/25/05 © 2005 University of Wisconsin
Sampling Henyey-Greenstein
• Because of the isotropic medium assumption, the distribution is separable into one for and one for
• Given 1 and 2:
• Given an incoming direction, use these to generate a scattered direction
2
2
22
1
21
11
2
1cos
2
gg
gg
g
02/25/05 © 2005 University of Wisconsin
PBRT Volume Models
• PBRT volumes must give– Extent (3D shape to intersect)
– Functions to return scattering parameters
– Function to return phase function at a point
– Function to compute optical thickness between two points
• Simplest is homogeneous volume– Everything is constant, and optical thickness comes from Beer’s law
02/25/05 © 2005 University of Wisconsin
Homogeneous Medium
02/25/05 © 2005 University of Wisconsin
Homogeneous with Varying Density
• Assume that the same medium is present, but that the density varies
• All parameters are scaled by density– Except optical thickness, which may be hard to compute
• Options:– 3D Grids – give sampled density on grid and interpolate
– Exponential density from some ground plane:
– Aggregates of volumes
bhaehd
02/25/05 © 2005 University of Wisconsin
Exponential Height Fog
02/25/05 © 2005 University of Wisconsin
Computing Optical Thickness
• Recall:
• Obviously we can use:
• The best way to get the T(j) is to use stratified sampling with a fixed offset– The offset is different for each query, but fixed among the T(j)
dt dtt0 , ppp
N
jj
jt
Tp
T
N 1)(
)( ,1 p
t0 t1u
T(5)
02/25/05 © 2005 University of Wisconsin
Equation of Transfer
• Radiance arriving is radiance leaving a surface that is attenuated plus radiance that gets in-scattered and emitted on the way from the surface– The transmittance describes the out-scattering and adsorption
– The source term describes the emission and in-scattering
t
t
tdSTLTLt
rori
pp
pp
ppppppp
0
0
00 ,,,
02/25/05 © 2005 University of Wisconsin
Solving Transfer Equation
• The hard part is the integral– Transmittance is simple – it depends only on optical thickness,
which we just saw how to compute
– Implementation increases step for transfer that is NOT to the camera
• Several possible assumptions in the integral– Emission only – simple because radiance from other directions is
not required
– Single-scattering only – simple because only radiance from light sources is considered
– Multiple – hard because you have to account for radiance from all directions, including other scattering events, so it blows up
02/25/05 © 2005 University of Wisconsin
Emission Only
• Choose points through the volume to evaluate emission
• Attenuate via transmittance
• Sum over points in Monte Carlo:
– Point are chosen using uniform offset stratified sampling (a few slides back) within the part of the ray that the volume occupies
– The transmittance can be computed cumulatively as we step along the ray
N
j
jve
jr LT
N
tt
1
)()(01 , ppp
02/25/05 © 2005 University of Wisconsin
Segment of Interest
• Viewer could be inside
• Visible surface could be inside
• Could pass right through
02/25/05 © 2005 University of Wisconsin
Cumulative Transmittance
02/25/05 © 2005 University of Wisconsin
Emission Example
02/25/05 © 2005 University of Wisconsin
Single Scattering
• Evaluates
• Very similar to previous slide, except:– At each point, sample light sources and
push through phase function to get and estimate of the inner integral
– Have to account for transmittance between light and sample point
– Actually, only sample one light for each sample point along the ray
t
S isver tddLpLT0
2,,, pppppp
02/25/05 © 2005 University of Wisconsin
Single Scattering Example
02/25/05 © 2005 University of Wisconsin
Multiple Scattering
• Can do it like path sampling– At each point along ray, sample multiple outgoing directions
– For each sampled direction, find first hit surface• Add in outgoing radiance from that surface – itself expensive to
compute
– For ray to first hit surface, recursively apply the algorithm• Account for scattering within the volume into this dircection
• Very computationally inefficient
• Speedups: Bi-Directional, Volumetric Photon Mapping
02/25/05 © 2005 University of Wisconsin
Next Time
• Sky models
• Sub-surface scattering