Chap 6
Real-Time Global Illumination
Part IV
Pre-computed Lighting
RTR, Chap 6 RT Global Illumination - Part 4 1 CGGM Lab., CS, NCTU, J. H. Chuang
Simple surface pre-lighting
• Full global lighting algorithms are costly
• Pre-computed lighting
– Some lighting information is pre-computed
– Then used during rendering
– Scene and light sources must remain static!
• Simple surface pre-lighting
– Light map
• Stores irradiance in Lambertian environments
• Memory constraints restricted the light map to be
relatively low resolution
– Matched well with Lambertian scenes
• Used in Quake II
RTR, Chap 6 RT Global Illumination - Part 4 2 CGGM Lab., CS, NCTU, J. H. Chuang
Simple surface pre-lighting
• Irradiance maps have no directionality
– Cannot be used with glossy surfaces
– Cannot be used with high-frequency normal
maps
– Some directional information must be stored too
• Directional surface pre-lighting
– For Lambertian surfaces
• Show how the irradiance changes with the surface
normal
– For glossy surfaces ?
RTR, Chap 6 RT Global Illumination - Part 4 3 CGGM Lab., CS, NCTU, J. H. Chuang
Directional surface pre-lighting
– The same as storing an irradiance environment
map at each surface location
• Stored as 9 RGB spherical harmonic coefficients
– Vertex values vs. texture map -- memory intensive
• Hemispherical harmonics - smaller number of
coefficients
– Radiosity normal mapping [Half-life 2 games]
• Represents directional irradiance at each point as three
RGB irradiance values, sampled in three directions in
tangent space
• At run time, the tangent space normal is read from
normal map and the irradiance is interpolated from the
three sampled irradiance values
• Produces results superior to low-order hemispherical
harmonics
RTR, Chap 6 RT Global Illumination - Part 4 4 CGGM Lab., CS, NCTU, J. H. Chuang
Directional surface pre-lighting
At rendering time, the tangent space
normal n is read from the normal map
and the irradiance is interpolat ed from
the three sampled irradiance values
( E0 , E1, E 2) :
2
max( mk n,0) 2 Ek
E ( n) k 0
2
max( mk n,0) 2
k 0
RTR, Chap 6 RT Global Illumination - Part 4 5 CGGM Lab., CS, NCTU, J. H. Chuang
Volume pre-lighting
• Surface pre-lighting can work well for
lighting static scenes.
How about dynamic objects?
• Irradiance volume (for diffuse scenes)
– Represents 5D irradiance function with a sparse
spatial sampling of irradiance environment map
• A 3D grid in space
• At each grid point
– irradiance environment map: represented as
» Spherical harmonics or radiosity normal mapping
– Dynamic objects interpolate irradiance values
from the closest of these environment maps
• Is straightforward: interpolate individual coefficient
values
RTR, Chap 6 RT Global Illumination - Part 4 6 CGGM Lab., CS, NCTU, J. H. Chuang
Volume pre-lighting
• Irradiance
– The irradiance distribution function can be
computed for every point in space: irradiance is
a 5D function (3 spatial dimensions and 2
directional dimensions)
– Evaluating the irradiance distribution function in
the direction of a surface normal gives us
irradiance at that surface location
– Computing irradiance distribution functions on
demand is possible but can be costly. An
obvious optimization is to pre-compute
irradiance distribution functions for a scene
RTR, Chap 6 RT Global Illumination - Part 4 7 CGGM Lab., CS, NCTU, J. H. Chuang
Volume pre-lighting
RTR, Chap 6 RT Global Illumination - Part 4 8 CGGM Lab., CS, NCTU, J. H. Chuang
Volume pre-lighting
Interpolation
• Dynamic objects interpolate irradiance values from
the closest of these environment maps
– For each orientation, compute a convolution of the field
radiance with a cosine kernel
RTR, Chap 6 RT Global Illumination - Part 4 9 CGGM Lab., CS, NCTU, J. H. Chuang
Volume pre-lighting
Compression
• How to store irradiance environment map?
– Diffuse cube map
– Projecting into spherical harmonics
• Projecting an environment map into 3rd order spherical
harmonics effectively gives you the irradiance
distribution function [Ramamoorthi]
– Represent the map as a spherical harmonics coefficients
• Projection into 3rd order SH is not only a storage win but
a preprocessing win too since SH projection is much
faster than convolving an environment map with a
cosine kernel for all possible normal orientations
• So GOOD for storage and evaluation
RTR, Chap 6 RT Global Illumination - Part 4 10 CGGM Lab., CS, NCTU, J. H. Chuang
Volume pre-lighting
Irradiance gradient
• The potential error increases the further we
move away from the sample
• Irradiance gradients allow us to store the
rate at which irradiance changes with
respect to the translations about the
sample
w/o gradient
with gradient
RTR, Chap 6 RT Global Illumination - Part 4 11 CGGM Lab., CS, NCTU, J. H. Chuang
Irradiance gradient
RTR, Chap 6 RT Global Illumination - Part 4 12 CGGM Lab., CS, NCTU, J. H. Chuang
Irradiance gradient
• One simple way to find the gradients
– use central differencing to estimate the partial
derivatives of the spherical harmonic irradiance
coefficients
– perform central differencing on each of the
coefficients
RTR, Chap 6 RT Global Illumination - Part 4 13 CGGM Lab., CS, NCTU, J. H. Chuang
Irradiance gradient
• At rendering time
– Use gradient to extrapolate the irradiance
• I’i: the i-th spherical harmonic coefficient of the
extrapolated irradiance function,
• Ii is the i-th spherical harmonic coefficient of the stored
irradiance sample,
• is the irradiance gradient for the i-th irradiance
coefficient , and
• d is a non-unit vector from the original sample location
to the point being rendered
RTR, Chap 6 RT Global Illumination - Part 4 14 CGGM Lab., CS, NCTU, J. H. Chuang
Pre-computed AO/occlusion
• Pre-computed ambient occlusion
– Ambient occlusion field [I3D05]
– Fast pre-computed ambient occlusion for
proximity shadows [J. of Graphics Tools, 06]
• Pre-computed occlusion
– Pre-computed shadow fields for dynamic scenes
[SIGGRAPH 2005]
RTR, Chap 6 RT Global Illumination - Part 4 15 CGGM Lab., CS, NCTU, J. H. Chuang
Ambient occlusion field
• Pre-compute ambient occlusion effects of
objects on each other
• Stores the AO effect of an object on its
surroundings in a cube map
– Each texel contains 7 scalar coefficients, which
in combination with the distance to the
occluding object’s center, are used to compute
the ambient occlusion
RTR, Chap 6 RT Global Illumination - Part 4 16 CGGM Lab., CS, NCTU, J. H. Chuang
Ambient occlusion field
RTR, Chap 6 RT Global Illumination - Part 4 17 CGGM Lab., CS, NCTU, J. H. Chuang
Ambient occlusion field
• Approximate the occluder by a spherical
cap when computing the ambient occlusion
on the receiver point
– A spherical cap is defined by a direction and a
solid angle
• Ambient occlusion field
– At points around the occluder, pre-compute and
store the subtended solid angle and the average
direction of occlusion
– These fields are stored as radical functions into
a cube-map surrounding the occluder
RTR, Chap 6 RT Global Illumination - Part 4 18 CGGM Lab., CS, NCTU, J. H. Chuang
Ambient occlusion field
Spherical cap approximation
• Ambient occlusion at a receiving point x
with normal n
• Spherical cap approximation
– Approximate ambient occlusion
• Spherical cap: Vcap(x,w)
– Visibility function of a cap from position x towards
direction w.
» Value 1 when w falls within the cap and 0 otherwise.
RTR, Chap 6 RT Global Illumination - Part 4 19 CGGM Lab., CS, NCTU, J. H. Chuang
Ambient occlusion field
Spherical cap approximation
Vcap approximates the visibility V(x, w) by a visibility of a corresponding
spherical cap.
The size of the spherical cap is determined so that it subtends the same
solid angle as the occluder.
The direction of the cap is given by the average of the occluded directions.
RTR, Chap 6 RT Global Illumination - Part 4 20 CGGM Lab., CS, NCTU, J. H. Chuang
Ambient occlusion field
Spherical cap approximation
• To evaluate the approximate ambient occlusion,
we need to have the spherical cap function
Vcap(x,w)
– The size of the cap
– Average direction of occlusion
• Based on (x) and (x) , we can evaluate ambient
occlusion using Eq. 3.
• How to store (x) and (x) more compactly?
RTR, Chap 6 RT Global Illumination - Part 4 21 CGGM Lab., CS, NCTU, J. H. Chuang
Ambient occlusion field
• Parameterize the field space by direction w
and the distance r from the center of the
occluder
– Field value: ( x) (, r ) and ( x) (, r )
– Stored in a cube map
• To compactly store the field value
– Assume that given a direction w, the field values
behave predictably as functions of distance r
• The solid angle subtended by an object is proportional
to the inverse square of r, i.e.,
RTR, Chap 6 RT Global Illumination - Part 4 22 CGGM Lab., CS, NCTU, J. H. Chuang
Ambient occlusion field
Store:
a(w), b(w), c(w)
and C0(w)
RTR, Chap 6 RT Global Illumination - Part 4 23 CGGM Lab., CS, NCTU, J. H. Chuang
Ambient occlusion field
• To compactly store the field value (cont.)
– Note that when going farther away from the
occluder,
• the average direction approaches the direction towards
the object’s center,
• while in the close proximity the direction might deviate
considerably.
– C0(w): a point in space in which the direction of occlusion
mostly points
RTR, Chap 6 RT Global Illumination - Part 4 24 CGGM Lab., CS, NCTU, J. H. Chuang
Ambient occlusion field
Run time
• When rendering the receiving surface
– The field values (polynomials) are fetched from
the cube map associated with the occluder
– To compute ambient occlusion from the
subtended solid angle and the direction
• We need to integrate a cosine weighted spherical cap
according to Eq. 3
• Based a small look-up table parameterized by solid
angle and the elevation angle relative to surface
RTR, Chap 6 RT Global Illumination - Part 4 25 CGGM Lab., CS, NCTU, J. H. Chuang
Ambient occlusion field
Examples
RTR, Chap 6 RT Global Illumination - Part 4 26 CGGM Lab., CS, NCTU, J. H. Chuang
Ambient occlusion field
Examples
Reference image: sampling the ao for each pixel
Self shadow is pre-computed.
RTR, Chap 6 RT Global Illumination - Part 4 27 CGGM Lab., CS, NCTU, J. H. Chuang
Ambient occlusion field
Examples
RTR, Chap 6 RT Global Illumination - Part 4 28 CGGM Lab., CS, NCTU, J. H. Chuang
Ambient occlusion field
Advantages and limitations
• Advantages
– Both storage and run-time overhead are low
enough for the use in real-time applications
– Low resolution cube map is ok for low frequency
shadowing
• Limitations
– Unable to do self shadowing
RTR, Chap 6 RT Global Illumination - Part 4 29 CGGM Lab., CS, NCTU, J. H. Chuang
Precomputer radiance transfer
(PRT)
RTR, Chap 6 RT Global Illumination - Part 4 30 CGGM Lab., CS, NCTU, J. H. Chuang
Precomputer radiance transfer
• Precomputed occlusion
– Models how an object blocks incoming light
– doesn’t model other global illumination effects
– Radiance transfer function
• Represents the transference of incoming radiance on
an object to outgoing radiance
• Precomputed radiance transfer
– Some representation of the transfer function of
the object is precomputed
– At rendering time, the transfer function is
applied to the incoming radiance to generate
the outgoing radiance from the object
RTR, Chap 6 RT Global Illumination - Part 4 31 CGGM Lab., CS, NCTU, J. H. Chuang
Precomputer radiance transfer
• Some general concepts
– Distant light assumption
• Incoming radiance depends only on incoming direction,
and not on position
– Represent the domain of such functions as
points on the unit sphere (point ~ vector (direction))
– Requires the incoming radiance be projected
into an appropriate basis
• The # of basis functions used must be small for
computation and storage reasons
• Restricts the possible incoming radiance to a low-
dimensional space
RTR, Chap 6 RT Global Illumination - Part 4 32 CGGM Lab., CS, NCTU, J. H. Chuang
Precomputer radiance transfer
• Sloan’s PRT uses spherical harmonics [Siggraph02]
– Precomputation: Transfer function is
represented as a set of SH coefficients
• Describe how much illumination is received, depending
on the incoming light’s direction
– At rendering time, lighting is projected onto the
SH basis (same # as the transfer function)
– Final lighting is the result of a dot product of the
lighting and transfer coefficients
• Outgoing radiance from each point is assumed to be
the same for all outgoing direction (diffuse surface).
• So outgoing radiance can be represented by a single
value.
RTR, Chap 6 RT Global Illumination - Part 4 33 CGGM Lab., CS, NCTU, J. H. Chuang
What is spherical harmonics?
Approximating a function on sphere
RTR, Chap 6 RT Global Illumination - Part 4 34 CGGM Lab., CS, NCTU, J. H. Chuang
Spherical harmonics
Reference
• Course note 18
– SIGGRAPH05: PRT: Theory and Practice
• Spherical harmonics lighting: The Gritty
Details, by Robin Green
• Stupid Spherical Harmonics Tricks, Sloan
• Sloan’s first PRT paper, SIGGRAPHICS 2002
RTR, Chap 6 RT Global Illumination - Part 4 35 CGGM Lab., CS, NCTU, J. H. Chuang
Spherical harmonics
Basis
l: index of basis function
RTR, Chap 6 RT Global Illumination - Part 4 36 CGGM Lab., CS, NCTU, J. H. Chuang
Spherical harmonics
Basis
The first 5 SH basis plotted as unsigned spherical functions by distance
From the origin and by color on a unit sphere. Green: positive, red: negative.
RTR, Chap 6 RT Global Illumination - Part 4 37 CGGM Lab., CS, NCTU, J. H. Chuang
Spherical harmonics
Approximating a spherical function
To approximate a spherical function f(s) using SH, we first find
the SH coefficients by projecting f onto the basis:
SH basis
And then do the summation using SH basis:
RTR, Chap 6 RT Global Illumination - Part 4 38 CGGM Lab., CS, NCTU, J. H. Chuang
Spherical harmonics
Approximating a spherical function
SH projection of functions (Original) with increasing orders of approximation.
RTR, Chap 6 RT Global Illumination - Part 4 39 CGGM Lab., CS, NCTU, J. H. Chuang
Spherical harmonics
Properties
• Are orthonormal
• Rotational invariant
– If g is a rotated copy of f, i.e., g=R(f), then
~(s) ~( R(s))
g f
– This is what many other compression methods
cannot claim!
• Integration of rendering equation becomes
a dot product!! Returns a single value! (Diffuse surfaces)
RTR, Chap 6 RT Global Illumination - Part 4 40 CGGM Lab., CS, NCTU, J. H. Chuang
Spherical harmonics lighting
• Diffuse surfaces
– Diffuse unshadowed transfer
– Diffuse shadowed transfer
– Diffuse interreflected transfer
• Glossy surfaces
RTR, Chap 6 RT Global Illumination - Part 4 41 CGGM Lab., CS, NCTU, J. H. Chuang
Diffuse PRT
• Sloan’s PRT uses spherical harmonics [Siggraph02]
– Precomputation: Transfer function is
represented as a set of SH coefficients
• Describe how much illumination is received, depending
on the incoming light’s direction
– At rendering time, lighting is projected onto the
SH basis (same # as the transfer function)
– Final lighting is the result of a dot product of the
lighting and transfer coefficients
Why ??
RTR, Chap 6 RT Global Illumination - Part 4 42 CGGM Lab., CS, NCTU, J. H. Chuang
Rendering equation
RTR, Chap 6 RT Global Illumination - Part 4 43 CGGM Lab., CS, NCTU, J. H. Chuang
Diffuse PRT
Diffuse: BRDF is a constant
Transfer function:
Li ( x, i ) L(i ) li yi (i ) [distant light, so indep on x]
i
Precomputed radiance transfer
x
L( x) li yi (i )V ( x, i ) max( N i ,0)di
i
x
i
li t xi or li t xi [fold the diffuse reflectivi ty into vector]
0
i
0
RTR, Chap 6 RT Global Illumination - Part 4 44 CGGM Lab., CS, NCTU, J. H. Chuang
Diffuse PRT
Rendering
RTR, Chap 6 RT Global Illumination - Part 4 45 CGGM Lab., CS, NCTU, J. H. Chuang
Diffuse PRT
Transfer function SH coefficients
Green: position
Red: negative
SH basis
Transfer SH coefficient
RTR, Chap 6 RT Global Illumination - Part 4 46 CGGM Lab., CS, NCTU, J. H. Chuang
Diffuse PRT
Rendering
RTR, Chap 6 RT Global Illumination - Part 4 47 CGGM Lab., CS, NCTU, J. H. Chuang
Diffuse PRT
Rendering
Light
Light SH coefficients
Transfer SH coefficients
Final image
RTR, Chap 6 RT Global Illumination - Part 4 48 CGGM Lab., CS, NCTU, J. H. Chuang
Diffuse PRT
• Radiance transfer vector
– Captures how an object casts shadows on itself
– Are evaluated using Monte Carlo sampling
• Lighting coefficients
– Are evaluated using Monte Carlo sampling
• # of SH basis
– 9 basis functions suffice for environment light
• [Ramamoorthi et al. An efficient representation for
irradiance environment map, SIGGRAPH 01]
– To better support shadow, Sloan’s first work
uses 24 basis functions
RTR, Chap 6 RT Global Illumination - Part 4 49 CGGM Lab., CS, NCTU, J. H. Chuang
Diffuse PRT
Example
RTR, Chap 6 RT Global Illumination - Part 4 50 CGGM Lab., CS, NCTU, J. H. Chuang
Diffuse PRT
Example
RTR, Chap 6 RT Global Illumination - Part 4 51 CGGM Lab., CS, NCTU, J. H. Chuang
Diffuse PRT
Example
RTR, Chap 6 RT Global Illumination - Part 4 52 CGGM Lab., CS, NCTU, J. H. Chuang
Diffuse PRT
Interreflection
RTR, Chap 6 RT Global Illumination - Part 4 53 CGGM Lab., CS, NCTU, J. H. Chuang
Diffuse PRT
Interreflection
RTR, Chap 6 RT Global Illumination - Part 4 54 CGGM Lab., CS, NCTU, J. H. Chuang
Diffuse PRT
Interreflection
• Recursively add in light not arriving directly from a light
source, but as secondary reflected light from other polygons
visible to the surface point.
Why??
RTR, Chap 6 RT Global Illumination - Part 4 55 CGGM Lab., CS, NCTU, J. H. Chuang
Diffuse PRT
Interreflection
L( p ) L0 ( p ) L1 ( p ) L2 ( p )
p
L1 ( p ) L0 (q ( s )) (1 V ( p, s )) max( N p s ,0)ds , where L0 (q ( s )) li t q ( s ),i
0
i
p
L1 ( p ) li t q ( s ),i (1 V ( p, s )) max( N p s ,0)ds
0
i
p 0
li t q ( s ),i (1 V ( p, s )) max( N p s ,0)ds
li t 1 ,i
p
i i
p 0
where t p ,i t q ( s ),i (1 V ( p, s )) max( N p s ,0)ds
1
To include the first bounce,
L( p ) L0 ( p ) L1 ( p ) li t 0 ,i li t 1 ,i li (t 0 ,i t 1 ,i ) li t p ,i
p p p p
i i i i
RTR, Chap 6 RT Global Illumination - Part 4 56 CGGM Lab., CS, NCTU, J. H. Chuang
Diffuse PRT
Interreflection
• Steps
RTR, Chap 6 RT Global Illumination - Part 4 57 CGGM Lab., CS, NCTU, J. H. Chuang
Diffuse PRT
Interreflection
RTR, Chap 6 RT Global Illumination - Part 4 58 CGGM Lab., CS, NCTU, J. H. Chuang
Diffuse PRT
Interreflection
• Geometric interpretation
– Each point on the model already knows how
much direct illumination it has, encoded in the
form of a transfer function.
– We fire rays to find sample points that can
reflect light back onto our position and add a
cosine weighted copy of that transfer function
back into our own.
RTR, Chap 6 RT Global Illumination - Part 4 59 CGGM Lab., CS, NCTU, J. H. Chuang
Diffuse PRT
Interreflection
Geometricinterpretation
• Point A in the
illustration above has
fired a ray and hit point
B.
• The transfer function at
B is added to A like
the right figure.
Directional light!!
• See how point A, when
lit by an SH light source,
will be illuminated by
light from above, even
though it cannot
directly see any.
RTR, Chap 6 RT Global Illumination - Part 4 60 CGGM Lab., CS, NCTU, J. H. Chuang
Diffuse PRT
Interreflection
RTR, Chap 6 RT Global Illumination - Part 4 61 CGGM Lab., CS, NCTU, J. H. Chuang
PRT lighting
• Diffuse PRT can model any view-
independent effect under arbitrary lighting
– Lambertian lighting, self-shadowing,
interreflection, color bleeding, subsurface
scattering
• Distant light vs. local light
– Distant light restriction can be relaxed in some
cases
• Glossy surfaces/all-frequency?
– Using SH or other basis
– Extremely cost in terms of computation and
storage; not a good fit for RTR applications.
RTR, Chap 6 RT Global Illumination - Part 4 62 CGGM Lab., CS, NCTU, J. H. Chuang
PRT lighting
• Compression
– Clustered principal components analysis
• Speed up rendering, saving space, but may results in
artifacts [By Sloan et al. SIGGRAPH 03]
RTR, Chap 6 RT Global Illumination - Part 4 63 CGGM Lab., CS, NCTU, J. H. Chuang
All-frequency PRT
Sharp shadow and glossy surfaces
• Wavelets for high-frequency illumination
• All-frequency shadows using non-linear wavelet lighting approximation, Ng et al.,
SIGGRAPH 03
• BRDF factorization
– Approximate non-diffuse BRDF by factoring them into
components that are dependent on the viewing direction
only and lighting direction only, i.e., 4D BRDF is split into
two 2D functions that are separately approximated using
Haar wavelets, which are further clustered using PCA.
• All-frequency precomputed radiance transfer for glossy objects, Liu et al., Euro. Sym. On
Rendering 2004
• All-frequency relighting of non-diffuse objects using separable BRDF approximation, Wang
et al., Euro. Sym. On Rendering 2004
• Triple product integral
– all-frequency lighting for direct illumination with glossy
materials
• Triple product Wavelet integrals for All-frequency relighting, Ng et al., SIGGRAPH 2004
RTR, Chap 6 RT Global Illumination - Part 4 64 CGGM Lab., CS, NCTU, J. H. Chuang
All-frequency PRT
Triple product integration
• Formulates the radiance as the product of three functions
– Lighting, material (BRDF + cos) , and visibility
– Each of these functions is projected into an orthonormal basis
RTR, Chap 6 RT Global Illumination - Part 4 65 CGGM Lab., CS, NCTU, J. H. Chuang
Precomputed Shadow field
RTR, Chap 6 RT Global Illumination - Part 4 66 CGGM Lab., CS, NCTU, J. H. Chuang
Shadow Fields
Introduction
• Consider lighting and visibility of each Object
independently
• Pre-compute for each scene entity a shadow field
that describes the shadowing effects of the entity
at points around it
• Papers
– Precomputed Shadow Fields for Dynamic Scenes
[SIGGRAPH 2005]
– Real Time Soft Shadow in Dynamic Scenes Using
Spherical Harmonic Exponentiation [SIGGRAPH’06]
• Faster than shadow Field in more complex & large
scenes
– A practical and Fast rendering algorithm for dynamic
scene using adaptive shadow fields [PG’06, TVC]
RTR, Chap 6 RT Global Illumination - Part 4 67 CGGM Lab., CS, NCTU, J. H. Chuang
Shadow Fields
Comparative study
• Traditional shadow techniques such as shadow
map and shadow volume
– Complexity depends on scene complexity
• And cannot be pre-computed
– Deal with small or point-like area source only
• Environment maps can not be efficiently handled
• Pre-computed radiance transfer (PRT)
– Transfer distant illumination from environment maps to
objects
• Extremely expensive to handle dynamic local lights.
– Dynamic scenes present an even greater problem because
the PRT matrices are only valid for a fixed scene
configuration.
• Re-computing transfer matrices for moving objects on-the-fly
is prohibitively expensive
RTR, Chap 6 RT Global Illumination - Part 4 68 CGGM Lab., CS, NCTU, J. H. Chuang
Shadow Fields
Advantages
• Pre-computed shadow field for each object and
fast run-time rendering
– Independent of scene complexity
– Can be quickly combined at run-time to generate soft
shadow
• Real time for low-frequency shadowing of dynamic scenes
• Real time for high-frequency shadowing of static scenes
• Interactive rate for high-frequency shadowing of dynamic
scenes with non-rotating light sources and objects
• Support local area light and environment light
– Traditional shadowing:
• Small and point-like area lights
– PRT:
• support environment lights
RTR, Chap 6 RT Global Illumination - Part 4 69 CGGM Lab., CS, NCTU, J. H. Chuang
Shadow Fields
Light Illumination Equation
L( x o ) L( x i )V ( x i ) ( x, i o )(nx i )di
n
L( x o ) Li ( x i )V0 ( x i )V1 ( x i )Vm ( x i ) ( x, i o )(nx i )di
i 0
– Lighting object (L0~Ln)
– Others object (O0~Om)
RTR, Chap 6 RT Global Illumination - Part 4 70 CGGM Lab., CS, NCTU, J. H. Chuang
Shadow Fields
SRF and OOF
• Source radiance field (SRF) for the local light
source
– Consists of cube maps that records incoming light from
the illuminant at surrounding sample points
– An environment map can be represented as a spatially-
independent SRF
• Object occlusion field (OOF) for the object
– Conversely records the occlusion of radiance (as alpha
values) by the object as viewed from sample points
around it
– Self occlusion
• Can be expressed as a special OOF that is pre-computed
at sampled points on an object’s surface
RTR, Chap 6 RT Global Illumination - Part 4 71 CGGM Lab., CS, NCTU, J. H. Chuang
Shadow Fields
SRF and OOF
• For a local light source
– its radiated illumination at an arbitrary point (x,
y, z) in the scene can be expressed as a 6D
plenoptic function
P( x, y, z , in , in , t ) or P( RP , P , P , in , in , t )
– Removing the time dependency, a SRF can be
represented as the 5D function
P ( RP , P , P , in , in )
• Or as cube maps ( in , in ) as a function of position P.
RTR, Chap 6 RT Global Illumination - Part 4 72 CGGM Lab., CS, NCTU, J. H. Chuang
Shadow Fields
Pre-computation
• SRF and OOF precomputation
The sampled cube map ( in , in ) of point q.
RTR, Chap 6 RT Global Illumination - Part 4 73 CGGM Lab., CS, NCTU, J. H. Chuang
Shadow Fields
Incident radiance computation
• At run-time, the SRFs and OOFs must be quickly
combined according to the scene configuration
– Scene alignment
• The fields induced by the light sources and objects are
aligned to their scene positions and orientations
– Distance sorting
• The distance of these scene entities from the shadow point
are sorted from near to far
– Occlusion aggregation
• For objects that lie closer to the shadow point than the light
source, their OOFs are multiplied to solve for their aggregate
occlusion
– Incident radiance computation
• The occlusion product is multiplied by the SRF of the light
source
RTR, Chap 6 RT Global Illumination - Part 4 74 CGGM Lab., CS, NCTU, J. H. Chuang
Shadow Fields
Incident radiance computation
RTR, Chap 6 RT Global Illumination - Part 4 CGGM CG Lab., CS Dept., NCTU Jung Hong Chuang
Lab., CS,
Shadow Fields
Example
• Incident Radiance Computation
– For S1: S1(p)∗Op
– For S2: S2(p)∗ O1(p)∗ Op
– For S3: S3(p)∗ O3(p)∗O2(p)∗O1 (p)∗ Op
– For Sd: Sd ∗ O3(p)∗O2(p)∗O1 (p)∗ Op
• Op can be considered as Oj (p)
• A*B means convolution of function A and B => A( x)B( x)dx
– Summing the radiance from each light source results in the
incident radiance at P.
RTR, Chap 6 RT Global Illumination - Part 4 76 CGGM Lab., CS, NCTU, J. H. Chuang
Shadow Fields
Soft shadow rendering
• The soft shadow at a scene point can be
computed based on the rendering equation
– B: outgoing radiance
– L: lighting vector
– V: visibility function
– ρ: BRDF
– n: normal at x
RTR, Chap 6 RT Global Illumination - Part 4 77 CGGM Lab., CS, NCTU, J. H. Chuang
Shadow Fields
Soft shadow rendering
• PRT approach (double product)
To compute B 2 L( )T ( )d
S
If
We can rewrite B as
RTR, Chap 6 RT Global Illumination - Part 4 78 CGGM Lab., CS, NCTU, J. H. Chuang
Shadow Fields
Soft shadow rendering
Tp
• The product of the self-visibility and the BRDF is first computed at p
and stored in Tp, which represent the product of OOF and BRDF.
• TP is iteratively updated by multiplying OOFs of increasing distance
from p.
• For a light source, its contribution to outgoing radiance is determined
by multiplying its SRF with the TP that incorporated the appropriate
set of OOFs (using double product approach).
• The contributions of each light source are finally aggregated to obtain
the soft shadow.
RTR, Chap 6 RT Global Illumination - Part 4 79 CGGM Lab., CS, NCTU, J. H. Chuang
Shadow Fields
Soft shadow rendering
• Triple product approach
RTR, Chap 6 RT Global Illumination - Part 4 80 CGGM Lab., CS, NCTU, J. H. Chuang
Shadow Fields
Results
Moving objects
Moving light sources
RTR, Chap 6 RT Global Illumination - Part 4 81 CGGM Lab., CS, NCTU, J. H. Chuang
Shadow Fields
Results
A local light source + environment light
Multiple local light sources
A local light source
represented by a video
texture
RTR, Chap 6 RT Global Illumination - Part 4 82 CGGM Lab., CS, NCTU, J. H. Chuang
Shadow Fields
Result & Problem
• On a dual Intel Xeon 3.0 GHz workstation.
• Memory storage problem
• Sampling problem
RTR, Chap 6 RT Global Illumination - Part 4 83 CGGM Lab., CS, NCTU, J. H. Chuang