Download CSE168 Computer Graphics II, Rendering

Document related concepts

Gravitational lens wikipedia , lookup

Transcript
CSE168
Computer Graphics II, Rendering
Spring 2006
Matthias Zwicker
Last time
• Realistic camera models
• High dynamic range imaging
Pinhole cameras
Pinhole cameras
Problems
• Small pinhole gathers little light, requires
long exposure
• Larger pinhole reduces sharpness
Lenses
Pinhole
Lens
6 sec. exposure
0.01 sec exposure
Thin lens model
• Approximative model for well-behaved
lenses
• All parallel rays
converge at focal
length
• Rays through the
center are not
deflected
Thin lens model
• All rays passing through a single point on
a plane at distance
in front of the lens
will pass through a single point at
distance
behind the lens
• Thin lens formula
Depth of field
• Blurriness of out of focus objects depends
on aperture size
Aperture
Depth of field
Ray tracing using a thin lens model
• Place image plane at distance D from lens plane
• Generate primary rays with random origin on
lens aperture
Pinhole
Thin lens
Object
in focus
Primary rays Image plane
Primary rays Image plane
HDR imaging
• Image sensors, display devices have a
smaller dynamic range than radiance in
real/simulated scenes
• Dynamic range: ratio of brightest to
darkest pixel in an image
HDR photography
• Acquire several images with different
exposures
• Recover a HDR intensity for each pixel
[Wikipedia]
Tone mapping
• Compress dynamic range of image without
losing detail for low dynamic range display
[Wikipedia]
Multi-scale methods
• Decompose image into coarse and detail layer
• Compress only coarse layer, then recombine
Today
• Participating media
• Subsurface scattering
Participating media
• So far: light reflection on surfaces, BRDFs
• What about interaction of light with
volumetric media?
[Greenler, “Rainbows, halos,
and glories”]
Participating media
Applications
• Clouds, smoke, water
• Subsurface scattering (paint, skin)
• Scientific/medical visualization (CT, MRI,
etc.)
Participating media
Topics
• Absorption, out-scattering, in-scattering,
emission
• Phase functions
• Volume rendering equation
• Ray tracing volumes
– Absorption/emission
– Single scattering
Absorption
• Absorption cross-section
• Rate of absorption
Out-scattering
• Scattering coefficient
• Rate of being scattered
Extinction
• Extinction: absorption and out-scattering
Extinction
[Pharr, Humphreys]
Transmittance
• Optical thickness
• Transmittance
Transmittance
• Multiplicative property
• Homogeneous media
Beer’s law
In-scattering
• Phase function
Phase functions
• Phase angle
• Isotropic
• Rayleigh: scattering from particles
smaller than wavelength of light
• Mie scattering: scattering from small
spheres, larger than wavelength
Henyey-Greenstein phase function
• Empirical phase function
• Useful for many phenomena (water, clouds,
skin, stone)
• Average phase angle , asymmetry parameter
Backward scattering
Forward scattering
Phase functions
• Unitless
• Reciprocity
• Energy conservation
• Amount of scattering is controlled by
Blue sky, red sunset
[Greenler]
The volume rendering equation
• Integro-differential form
• Integro-integral form
Extinction (absorption,
out-scattering)
Source (emission,
in-scattering)
The volume rendering equation
• Full solution is very expensive to
compute, intractable for complicated
scenes
• Rendering with simplified models
• Emission/absorption only
• Single scattering
Absorption/emission only
• No in-scattering
Volume emission
• Remember transmittance
Ray marching
• Monte Carlo approximation
• Uniformly distributed samples
Ray marching
• Incremental computation of transmittance
Ray marching
T = 1
L = 0
ds = (s_out – s_in) / N
for( s = s_in; s <= s_out; s += ds ) {
L = L + T * L_ve
T = T * ( 1 – sigma_t(s) ) * ds
}
L = L * ds
Absorption/emission only
[Pharr, Humphreys]
Volume visualization
• Visualize scalar data on volumetric grid
• CT, MRI scans, …
• Scalar data represents some physical
property of a material
• Medical/industrial applications
• Transfer function assigns color/opacity
value to each scalar value
Volume visualization
Volume rendering: ray marching/ray
casting as described before
Single scattering
• Include in-scattering of incident radiance due to
direct illumination
In-scattering,
• Direct illumination from light sources
• Phase function
• Scattering coefficient
Single scattering
• Direct illumination needs to be attenuated
• Shoot shadow rays
Shadow rays
T = 1
dt = t_out – t_in / N
for( t = t_in; t <= t_out; t += dt ) {
T = T * ( 1 – sigma_t(t) ) * dt
}
L_d = T * L_s // L_s: light source
S = sigma_s * p * L_d // p: phase function
Single scattering
[Pharr, Humphreys]
Beams of light
[Greenler]
[Minneart]
Multiple scattering
• Path tracing, very slow
• Photon mapping
“Efficient Simulation of Light Transport in
Scenes with Participating Media using
Photon Maps”, Jensen, Christensen
“Realistic Image Synthesis using Photon
Mapping”, Jensen
Photon mapping
• Volume caustics
[Jensen]
Questions?
Subsurface scattering
• So far: BRDFs, light scatters exactly at the
point where it hits the surface
• Subsurface scattering: light enters the
material, bounces around, leaves at a
different place
• Describe scattering properties of material
using an extension of BRDFs
Subsurface scattering
• BSSRDF: bidirectional surface scattering
reflectance distribution function
BRDF
BSSRDF
Subsurface scattering
• BSSRDF has 8 degrees of freedom (2
positions, 2 orientations)
• Hard to capture in the general case
• Brute force Monte Carlo simulation very
expensive
Subsurface scattering
Diffusion approximation
• Light distribution in highly scattering
media tends to become isotropic
• We can a find a diffuse BSSRDF
where
• Also known as “dipole model”
Subsurface scattering
Diffusion approximation
[Jensen et al.]
Diffusion profile
Subsurface scattering
BSSRDF
BRDF
[Jensen et al.]
Subsurface scattering
BRDF
BSSRDF
Monte Carlo
simulation
[Jensen et al.]
Efficient rendering
• “A Rapid Hierarchical Rendering
Technique for Translucent Materials”,
Jensen, Buhler
• Two pass approach
• First, compute irradiance at a set of
surface points
• Second, evaluate diffuse BSSRDF by
gathering irradiance samples
• Use efficient hierarchical scheme
Efficient rendering
• Irradiance gathering using the diffuse
BSSRDF
Irradiance
sample
Reflected radiance
Efficient rendering
Irradiance
samples
Final
image
[Jensen, Buhler]
Efficient rendering
• Global illumination and subsurface
scattering
[Jensen, Buhler]
Next time
• Guest lecture