1
Lecture 3: Rendering Equation
CS 6620, Spring 2009Kavita Bala
Computer ScienceCornell University
© Kavita Bala, Computer Science, Cornell University
Radiometry
• Radiometry: measurement of light energy
• Defines relation between– Power– Energy– Radiance– Radiosity
2
© Kavita Bala, Computer Science, Cornell University
Hemispherical coordinates
• Defined a measure over hemisphere• dω = direction vector• Differential solid angle
ϕθθω ddrdAd sin2 ==
© Kavita Bala, Computer Science, Cornell University
Radiance
• Radiance is radiant energy at x in direction θ: 5D function– : Power
per unit projected surface areaper unit solid angle
– units: Watt / m2.sr
Θ⊥=Θ→
ωddAPdxL
2
)(
)( Θ→xL
dA⊥
Θ
x
Θωd
3
© Kavita Bala, Computer Science, Cornell University
Why is radiance important?
• Invariant along a straight line (in vacuum)
x1
x2
Θ
x
© Kavita Bala, Computer Science, Cornell University
Why is radiance important?
• Response of a sensor (camera, human eye) is proportional to radiance
• Pixel values in image proportional to radiance received from that direction
eye
4
© Kavita Bala, Computer Science, Cornell University
Relationships• Radiance is the fundamental quantity
• Power:
• Radiosity:
dAdxLPArea
AngleSolid
⋅⋅⋅Θ→= ∫ ∫ Θωθcos)(
∫ Θ⋅⋅Θ→=
AngleSolid
dxLB ωθcos)(
Θ⊥=Θ→
ωddAPdxL
2
)(
© Kavita Bala, Computer Science, Cornell University
Outline
• Light Model
• Radiance
• Materials: Interaction with light
• Rendering equation
5
© Kavita Bala, Computer Science, Cornell University
Materials - Three Forms
Ideal diffuse (Lambertian)
Idealspecular
Directionaldiffuse
© Kavita Bala, Computer Science, Cornell University
Reflectance—Three Forms
Ideal diffuse (Lambertian)
Directionaldiffuse
Idealspecular
6
© Kavita Bala, Computer Science, Cornell University
• Bidirectional Reflectance Distribution Function
BRDF
DetectorDetectorLight Light SourceSource
NN
Θ
x
Ψ
2mW srm
W2
)()(),(
Ψ←Θ→
=Θ→ΨxdExdLxfr
© Kavita Bala, Computer Science, Cornell University
Definition of BRDF
)()(),(
Ψ←Θ→
=Θ→ΨxdExdLxfr
ΨΨΨ←Θ→
=ωdNxL
xdL
x ),cos()()(
• 6D function? 4D function?– Why?
• Wavelength-dependent
7
© Kavita Bala, Computer Science, Cornell University
BRDF special case: ideal diffuse
Pure Lambertian
πρd
r xf =Θ→Ψ ),(
10 ≤≤ dρin
outd Energy
Energy=ρ
© Kavita Bala, Computer Science, Cornell University
Properties of the BRDF
• Reciprocity:
• Therefore, notation:
• Important for bidirectional tracing
),(),( Ψ→Θ=Θ→Ψ xfxf rr
),( Θ↔Ψxfr
8
© Kavita Bala, Computer Science, Cornell University
Properties of the BRDF• Bounds:
∞≤Θ↔Ψ≤ ),(0 xfr
1),cos(),( ≤ΘΘ↔ΨΨ∀ ∫Θ
ΘωdNxf xr
• Energy conservation:
© Kavita Bala, Computer Science, Cornell University
Outline
• Light Model
• Radiance
• Materials: Interaction with light
• Rendering equation
9
© Kavita Bala, Computer Science, Cornell University
Light Transport• Goal
– Describe steady-state radiance distribution in scene
• Assumptions:– Geometric Optics– Achieves steady state instantaneously
• Related:– Neutron Transport (neutrons)– Gas Dynamics (molecules)
© Kavita Bala, Computer Science, Cornell University
Radiance represents equilibrium• Radiance values at all points in the scene
and in all directions expresses the equilibrium
• 4D function: only on surfaces
10
© Kavita Bala, Computer Science, Cornell University
Rendering Equation (RE)• RE describes energy transport in scene
• Input– Light sources– Surface geometry– Reflectance characteristics of surfaces
• Output: value of radiance at all surface points in all directions
© Kavita Bala, Computer Science, Cornell University
Rendering Equation
)( Θ→xL
L
x
Θ
)( Θ→xLe
Le
x=
=
+
+ )( Θ→xLr
Lr
x
11
© Kavita Bala, Computer Science, Cornell University
Rendering Equation
)( Θ→xLe
Le
xx =
=
+
+
Lr
x
x
x
)( Θ→xL
LΘ
© Kavita Bala, Computer Science, Cornell University
Rendering Equation
)( Θ→xLe
Le
x=
=
+
+
Lr
x
)( Ψ←xL ...∫hemisphere
x
)( Θ→xL
LΘ
12
© Kavita Bala, Computer Science, Cornell University
Rendering Equation
ΨΨΨ←Θ↔Ψ=Θ→ ωdNxLxfxdL xr ),cos()(),()(
ΨΨΨ←Θ↔Ψ=Θ→ ∫ ωdNxLxfxL xhemisphere
rr ),cos()(),()(
)()(),(
Ψ←Θ→
=Θ↔ΨxdExdLxfr
)(),()( Ψ←Θ↔Ψ=Θ→ xdExfxdL r
© Kavita Bala, Computer Science, Cornell University
Rendering Equation
=
= )( Θ→xLe
Le
x +
+
Lr
x
)( Ψ←xL ΨΨΘ↔Ψ ωdxfr ),cos(),( xN∫hemisphere
• Applicable for each wavelength
x
)( Θ→xL
LΘ
13
© Kavita Bala, Computer Science, Cornell University
Rendering Equation
+Θ→=Θ→ )()( xLxL e
x ΨΨΘ↔ΨΨ←∫ ωdxfxLhemisphere
r ),cos(),()( xN
incoming radiance
© Kavita Bala, Computer Science, Cornell University
Summary
• Geometric Optics
• Goal: – to compute steady-state radiance values in
scene
• Rendering equation: – mathematical formulation of problem that global
illumination algorithms must solve
14
© Kavita Bala, Computer Science, Cornell University
RE: Area Formulation
)( Ψ←xL
)( Ψ−→yL
Ray-casting function: whatis the nearest visible surfacepoint seen from x in direction Ψ?
)),(()(),(
Ψ−→Ψ=Ψ←Ψ=
xvpLxLxvpy
x
y
∫Ω
Ψ⋅⋅Ψ←⋅Θ↔Ψ+Θ→=Θ→x
dxLfxLxL xre ωθcos)()()()(
© Kavita Bala, Computer Science, Cornell University
∫Ω
Ψ⋅⋅Ψ←⋅Θ↔Ψ+Θ→=Θ→x
dxLfxLxL xre ωθcos)()()()(
Rendering Equation
dAy
Ψωd
Ψ
x
2
cos
xy
yy
rdA
dθ
ω =Ψ
),( Ψ= xvpy
)),(()( Ψ−→Ψ=Ψ← xvpLxL
15
© Kavita Bala, Computer Science, Cornell University
Rendering Equation: visible surfaces
∫Ω
Ψ⋅⋅Ψ←⋅Θ↔Ψ+Θ→=Θ→x
dxLfxLxL xre ωθcos)()()()(
• Integration domain extended to ALL surface points by including visibility function
+Θ→=Θ→ )()( xLxL e
),( Ψ= xvpy
Integration domain = visible surface points y
Coordinate transform
∫surfaces all
on y)( Ψ−→⋅ yL)( Θ↔Ψrf y
xy
yx dA
r⋅⋅ 2
coscos
θθ
© Kavita Bala, Computer Science, Cornell University
∫ ⋅⋅⋅
⋅Ψ−→⋅+=Θ→A
yxy
yxre dAyxV
ryLfLxL ),(
coscos)((...)(...))( 2
θθ
Rendering Equation: all surfaces
x
16
© Kavita Bala, Computer Science, Cornell University
Two forms of the RE• Hemisphere integration
• Area integration (over polygons from set A)
∫ ⋅⋅⋅
⋅Ψ−→⋅Θ↔Ψ+Θ→=Θ→A
yxy
yxre dAyxV
ryLfxLxL ),(
coscos)()()()( 2
θθ
∫Ω
Ψ⋅⋅Ψ←⋅Θ↔Ψ+Θ→=Θ→x
dxLfxLxL xre ωθcos)()()()(
© Kavita Bala, Computer Science, Cornell University
Lighting Cues
glossy reflection
refraction
soft shadow
color bleeding
Global Illumination is important for realism
17
Light Sources and Reflection Models
© Kavita Bala, Computer Science, Cornell University
Outline• Light sources
– Light source characteristics– Types of sources
• Light reflection– Physics-based models– Empirical models
18
© Kavita Bala, Computer Science, Cornell University
Sources of light radiation• Thermal radiation (“blackbody”)
– Sun, tungsten & tungsten-halogen lamps; arc lamps
• Electric discharge– gas discharge lamps (neon, sodium, mercury vapor)– arc lamps, fluorescent lamps
• Other phenomena– fluorescence (fluorescent lamps, fluorescent dyes)– phosphorescence (CRTs); LEDs; lasers
© Kavita Bala, Computer Science, Cornell University400 500 600 700
1
2
3
4
Wavelength
Brig
htne
ss
Mercurylines
Phosphor emission
400 500 600 700
1
2
3
4
Wavelength
Brig
htne
ss
Mercury vapor lampExamples of light emission
10-2
10-1
1
10
102
103
104
105
106
107
10 100 1000 10000
Wavelength
Inte
nsity
20,000K
10,000K
3000K2000
K1000K
500K
VisibleSpectrum
6000K
19
© Kavita Bala, Computer Science, Cornell University
Modeling luminaires• Spectral distribution
– Determined by physics of source– Generally tabulated, often RGB used
• Spatial distribution– Modeled as point or simple area light– Also light probes create high dynamic range inputs
• Directional distribution– Often shaped by reflectors– Tabulated when necessary, cosine lobe is common
approximation
© Kavita Bala, Computer Science, Cornell University
Directional distributions
Lambertian cosine-power arbitrary
20
© Kavita Bala, Computer Science, Cornell University
Lighting w/ Environment Maps• High lighting complexity
• Rich: captures real world
© Kavita Bala, Computer Science, Cornell University
Image-based lighting• Acquiring lighting information of real
scenes– Image-based techniques
• Use light probe
• Varying exposure