Illumination and Direct Reflection

Download Report

Transcript Illumination and Direct Reflection

Illumination and Direct Reflection
Kurt Akeley
CS248 Lecture 12
1 November 2007
http://graphics.stanford.edu/courses/cs248-07/
Quantum electrodynamics
CS248 Lecture 12
Kurt Akeley, Fall 2007
Our premise
Goals:

Communicate, take advantage of human perception, and/or

Model reality
Radiative heat-transfer approximation

Treat light as packets of energy (photons)

Model their transport as a flow
Simplifications:

Ignore QED effects


Diffraction, interference, polarization, …
Assume geometric optics

Photons travel in straight lines

Intensities can be added
CS248 Lecture 12
Kurt Akeley, Fall 2007
Point Light Source
CS248 Lecture 12
Kurt Akeley, Fall 2007
Irradiance
F = flux, radiated power (W )
E = irradiance, incident power on a surface (W m 2 )
sr = Steradian, unit solid angle (a full sphere is 4p sr)
I = radiant intensity given off by a point light source (W sr )
uv
uv
I w = radiant intensity in direction w (W sr )
()
dA = differential unit area (m 2 )
uv
uv
dA w = differential unit area oriented in direction w (m 2 )
()
d w = differential unit solid angle (sr )
L = radiance given off by a (projected) surface (W sr m 2 )
uv
uv
L w = radiance in direction w (W sr m 2 )
()
dF
E=
dA
CS248 Lecture 12
Kurt Akeley, Fall 2007
Solid angles
F = flux, radiated power (W )
E = irradiance, incident power on a surface (W m
2
uv
w
)
sr = Steradian, unit solid angle (a full sphere is 4p sr)
I = radiant intensity given off by a point light source (W sr )
uv
uv
I w = radiant intensity in direction w (W sr )
Area=1
()
dA = differential unit area (m 2 )
uv
uv
dA w = differential unit area oriented in direction w (m 2 )
()
d w = differential unit solid angle (sr )
1 sr
L = radiance given off by a (projected) surface (W sr m 2 )
uv
uv
L w = radiance in direction w (W sr m 2 )
()
dF
E=
dA
CS248 Lecture 12
Kurt Akeley, Fall 2007
Radiant Intensity (point source, uniform)
F = flux, radiated power (W )
E = irradiance, incident power on a surface (W m 2 )
sr = Steradian, unit solid angle (a full sphere is 4p sr)
I = radiant intensity given off by a point light source (W sr )
uv
uv
I w = radiant intensity in direction w (W sr )
()
d w = differential unit solid angle (sr )
dA = differential unit area (m 2 )
uv
uv
dA w = differential unit area oriented in direction w (m 2 )
()
L = radiance given off by a (projected) surface (W sr m 2 )
uv
uv
L w = radiance in direction w (W sr m 2 )
I=
W
4p
()
dF
E=
dA
CS248 Lecture 12
uv
dF
I w =
dw
()
Kurt Akeley, Fall 2007
Radiant Intensity (point source, nonuniform)
F = flux, radiated power (W )
E = irradiance, incident power on a surface (W m
2
uv
w
)
sr = Steradian, unit solid angle (a full sphere is 4p sr)
I = radiant intensity given off by a point light source (W sr )
uv
uv
I w = radiant intensity in direction w (W sr )
dw
()
d w = differential unit solid angle (sr )
dA = differential unit area (m 2 )
uv
uv
dA w = differential unit area oriented in direction w (m 2 )
()
L = radiance given off by a (projected) surface (W sr m 2 )
uv
uv
L w = radiance in direction w (W sr m 2 )
()
dF
E=
dA
CS248 Lecture 12
uv
dF
I w =
dw
()
Kurt Akeley, Fall 2007
Radiant Intensity (point source, nonuniform)
F = flux, radiated power (W )
E = irradiance, incident power on a surface (W m
2
uv
w
)
sr = Steradian, unit solid angle (a full sphere is 4p sr)
I = radiant intensity given off by a point light source (W sr )
uv
uv
I w = radiant intensity in direction w (W sr )
dA
()
d w = differential unit solid angle (sr )
r
dw
dA = differential unit area (m 2 )
uv
uv
dA w = differential unit area oriented in direction w (m 2 )
()
L = radiance given off by a (projected) surface (W sr m 2 )
uv
uv
L w = radiance in direction w (W sr m 2 )
()
dw =
dF
E=
dA
CS248 Lecture 12
uv
dF
I w =
dw
dA
r2
()
Kurt Akeley, Fall 2007
Illumination (point source)
Of an oriented unit area by a point light source
dF
E=
dA
uv
I wi d w
=
dA
uv
I wi dA cos qi
=
dA ×r 2
uv
I wi cos qi
=
r2
uv n ×l
= I wi 2
r
( )
( )
( )
( )
definition
Projected area
factor
dw
uv
dF
I w =
dw
uv
wi
()
n
dA
d w = 2 ×cos qi
r
qi
l
cancellation
r > > dA
dot product def.
dA
dA×cos qi
CS248 Lecture 12
Kurt Akeley, Fall 2007
Reflected Light
CS248 Lecture 12
Kurt Akeley, Fall 2007
Radiance (from oriented differential area)
uv
w
v
n
F = flux, radiated power (W )
E = irradiance, incident power on a surface (W m 2 )
sr = Steradian, unit solid angle (a full sphere is 4p sr)
I = radiant intensity given off by a point light source (W sr )
uv
uv
I w = radiant intensity in direction w (W sr )
()
d w = differential unit solid angle (sr )
q
dw
v
dA n
()
uv
dA w
()
dA = differential unit area (m )
uv
uv
dA w = differential unit area oriented in direction w (m 2 )
2
()
L = radiance given off by a (projected) surface (W sr m 2 )
uv
uv
L w = radiance in direction w (W sr m 2 )
()
dF
E=
dA
CS248 Lecture 12
uv
dF
I w =
dw
()
uv
uv
dI w
dI w
uv
L w =
uv =
v
dA w
dA n ×cos q
uv
dI w
dF
L=
=
dA ×cos q d w ×dA ×cos q
()
()
()
()
()
()
Kurt Akeley, Fall 2007
Radiance is distance invariant
Sample color value is determined by radiance

Distance doesn’t matter

Intuitively doubling the distance

Reduces the energy from a unit area by factor of 4

Increases the area “covered” by the sample by a factor of 4
Multi-sample antialiasing filters radiance values
Why does a fire feel warmer, but have the same radiance
(apparent brightness), when you are closer to it?
CS248 Lecture 12
Kurt Akeley, Fall 2007
Diffuse reflection
Scatter proportion

Function of θr

Invariant to θi
n
kd ×cos qr
qr
Goniometric diagram
(Lambertian scatter)
uv
d I wr = (kd ×cos qr )×E ×dA
( )
CS248 Lecture 12
Kurt Akeley, Fall 2007
Diffuse reflection
uv
d I wr = (kd ×cos qr )×E ×dA
( )
uv n ×l
= (kd cos qr )×I wi × 2 ×dA
r
( )
uv
uv n ×l
1
L wr = (kd cos qr )×I wi × 2 ×dA ×
r
dA ×cos qr
æn ×l ÷
ö uv
= kd ×çç 2 ÷
÷×I wi
çè r ø
( )
( )
( )
CS248 Lecture 12
prev. slide
uv n ×l
dF
E=
= I wi 2
dA
r
( )
uv
L wr =
( )
uv
d I wr
( )
dA ×cos qr
cancellation
Kurt Akeley, Fall 2007
Lambertian radiance
n
kd ×cos qr
qr
Lambertian scatter
uv
L wr
n
( )
qr
Goniometric
diagram
Lambertian Radiance
(Lambertian scatter)
CS248 Lecture 12
Kurt Akeley, Fall 2007
The moon
CS248 Lecture 12
Kurt Akeley, Fall 2007
Isotropic scatter (dusty surface)
n
qr
Goniometric
diagram
Isotropic scatter
uv
L wr
( )
n
qr
Radiance
(Lambertian scatter)
CS248 Lecture 12
Kurt Akeley, Fall 2007
Retroreflection (2-D)
The moon is actually
somewhat retroreflective
CS248 Lecture 12
Kurt Akeley, Fall 2007
BRDF
Relates

Incoming irradiance to

Outgoing radiance
Degrees of freedom

4 in general (anisotropic)

3 in isotropic case

Add one for spectral
Isotropic:
CS248 Lecture 12
fr (qi , f i ; qr , f r )= fr (qi , qr , f r - f i )
Kurt Akeley, Fall 2007
Anisotropic
Texture filtering (2 lectures ago)
Surface characteristics
CS248 Lecture 12
Kurt Akeley, Fall 2007
BSSRDF
CS248 Lecture 12
Kurt Akeley, Fall 2007
How can you implement BRDFs?
CS248 Lecture 12
Kurt Akeley, Fall 2007
Texture mapping
Paints images onto triangles
Paints images onto points, lines, and other images
Ties the vertex and pixel pipelines together
 Rendered images can be used as textures

To modify the rendering of new images
– That can be used as textures …
Implements general functions of one, two, or three parameters
 Specified as 1-D, 2-D, or 3-D tables (aka texture images)
 With interpolated (aka filtered) lookup
Drives the hardware architecture of GPUs
 Multi-thread latency hiding
 “shader” programmability
Adds many capabilities to OpenGL
 Volume rendering
 Alternate color spaces
 Shadows …
CS248 Lecture 12
Kurt Akeley, Fall 2007
Shading vs. lighting
Lighting

Light transport

Interaction of light with surfaces
Shading

Interpolation of radiance values

Examples:

Smooth shading (aka Gouraud Shading)

Flat shading (aka constant shading)
Shader

Program run per vertex/primitive/fragment

Really more of a “lighter” than a “shader”
CS248 Lecture 12
Kurt Akeley, Fall 2007
Summary
Diffuse lighting

Radiance specified by n•l

Cosine fall-off is due to irradiance, not scattering

Many factors are ignored (often even the r2 fall-off)
Bidirectional reflectance distribution function (BRDF)

Ratio of reflected radiance to incident irradiance

Integrate over all incident light to get reflected radiance

5 DOF including spectral information

3 DOF for isotropic, non-spectral
Texture mapping is a powerful, general-purpose mechanism

It’s not just painting pictures onto triangles!
CS248 Lecture 12
Kurt Akeley, Fall 2007
Assignments
Next lecture: Z-buffer
Reading assignment for Tuesday’s class

FvD 15.1 through 15.5
CS248 Lecture 12
Kurt Akeley, Fall 2007
End
CS248 Lecture 12
Kurt Akeley, Fall 2007