Beruflich Dokumente
Kultur Dokumente
ILLUMINATION MODELS
Andrs Iglesias
e-mail: iglesias@unican.es
Web pages: http://personales.unican.es/iglesias
http://etsiso2.macc.unican.es/~cagd
Illumination Models
Light energy falling on a surface can be:
reflected light
heat
Absorbed
Reflected
Transmitted
transmitted light
absorbed
light (heat)
Illumination Models
Rogers, D.F. Procedural Elements for Computer Graphics, McGraw-Hill, 2nd. Edition, 1998
depends on:
Composition of the light source
Direction of the light source
Geometry of the light source
Illumination Models
Each point may have several sources of illumination:
According to how they handle these sources, algorithms can be grouped into:
direct illumination
indirect illumination
light arrives straight from the light light arrives after interacting with
sources
the rest of the scene
Illumination Models
Some useful definitions:
Normal vector
N
to light source
L - light source
direction
N - Normal vector
angle of
incidence
Illumination Models
Illumination model 1: Ambient light
K= 0.5
K= 0.6
Ambient light
Intensity of
I = K I
Uniform from all directions
ambient light
K measures reflectivity of
surface for diffuse light
Ambient reflection coefficient
(values in the range: 0-1)
Illumination Models
Illumination model 2: Ambient + diffuse light
Lamberts Cosine Law
incident intensity from a point light source
diffuse reflection function
wavelenght
(0 Kd() 1)
0
2
ambient light
Illumination Models
Illumination model 2: Ambient + diffuse light
In practice, dependence on the wavelength is usually omitted:
0
2
I = Il Kd cos() + K I
diffuse light
K + Kd < 1
ambient light
cos()= N.L
dot product
I = Il Kd (N.L) + K I
diffuse light
ambient light
0
2
K + Kd < 1
Illumination Models
Illumination model 2: Ambient + diffuse light
Surfaces with a simple Lambertian diffuse reflection appear to have
a dull matte surface:
K= 0.7
Kd= 0.2
K= 0.5
Kd= 0.4
K= 0.6
Kd= 0.3
2001 Andrs Iglesias. See: http://personales.unican.es/iglesias
Illumination Models
Specular reflection
is directional
Illumination Models
Illumination model 3: Ambient + diffuse + specular light
Normal vector
N
L
to light source
V
line of sight
Illumination Models
Illumination model 3: Ambient + diffuse + specular light
Phong Model
Because of the complex
physical characteristics of
the specular light, an
empirical model based on
taking the function:
n=1
0.8
0.6
0.4
0.2
f()=cosn()
where n depends on surface
properties. For:
a perfect reflector, n=
very poor reflector n=1
in practice use 1 n 200
n=5
--1.5
2
-1
-0.5
n=50
0.5
1.5
In general, we use:
Larger values of n for metals and other
shiny surfaces
Small values of n for nonmetallic
surfaces (e.g., paper)
2001 Andrs Iglesias. See: http://personales.unican.es/iglesias
Illumination Models
Illumination model 3: Ambient + diffuse + specular light
Phongs empirical model controls the size of the specular highlight
incident intensity from a point light source
wavelenght
reflectance curve
Total
Intensity
light
Ambient light +
Diffuse light
Specular light
Illumination Models
Illumination model 3: Ambient + diffuse + specular light
Ks= 0.2
Ks= 0.4
Ks= 0.6
Illumination Models
Illumination model 3: Ambient + diffuse + specular light
I = K I + Il Kd cos() + Il Ks cosn()
K= 0.6
Kd= 0.3
Ks= 0.2
K= 0.5
Kd= 0.4
Ks= 0.4
K Ambient reflection
Kd Diffuse reflection
Ks Specular reflection
K= 0.7
Kd= 0.2
Ks= 0.8
Illumination Models
Illumination model 3: Ambient + diffuse + specular light
Noting that:
cos()= N.L
cos() = R.V
I = K I + Il Kd (N.L)+ Il Ks (R.V)n
I=
Isource
dp + K
K is an arbitrary constant
used to prevent infinite
intensity when d=0
Illumination Models
Illumination model 4: Ambient + diffuse + specular + attenuation light
Phong, B. T. Illumination for Computer Generated Images, Communications of the ACM,
Vol. 18, pp. 311-317, 1975.
Phong Model:
Il
n())
(K
cos()
+
K
cos
d
s
p
d +K
I = K I +
Illumination Models
Polygon shading
Until now, we compute the intensity light at a single point on a surface
Polygon shading
How to compute the intensity across the polygon ?
1. Compute the shade at all points: 3. Compute shade at key points
Unnecessary and impractical
and interpolate for the rest:
2. Compute the shade at the centre Gouraud and Phong shading
and use this to represent the whole
polygon: Flat shading
Flat
Gouraud
Phong
Illumination Models
Illumination Models
Polygon shading: Flat shading
Is the simplest method and the most computationally efficient.
But it is also:
Faceted Appearance
Illumination Models
Polygon shading: Flat shading
3. Mach banding: brightness perceived
by the eye tends to overshoot at the
boundaries of regions of constant
intensity
Ibackground = 1 Ibackground = 0
Icenter = 0.5 Icenter = 0.5
Illumination Models
Polygon shading: Gouraud shading
Gouraud, H. Computer Display of Curved Surfaces, IEEE Transactions on Comput.,
C-20, pp. 623-628, 1971.
A
Scan
line
Output: IQ, IR
P
Output: IP
B
2001 Andrs Iglesias. See: http://personales.unican.es/iglesias
Illumination Models
Polygon shading: Gouraud shading
1. First compute the intensity values at each polygon vertex
w=uxv=
i
j
k
v
u1 u2 u3
v1 v2 v3
v1
Nv
N4
N1
v4
v
N3
v2
N2
v3
N2
N3
N4
Illumination Models
Polygon shading: Gouraud shading
2. Next compute the intensity at points Q and R using linear
interpolation
D
IQ=u IA+(1-u) IB
where u=
AQ
AB
Intensity at a point R:
IR=v IC+(1-v) ID
CR
where v=
CD
u
Scan
line
x
Q
x
v
C
B
Intensity at a point Q:
Illumination Models
Polygon shading: Gouraud shading
D
Intensity at a point P:
IR=t IQ+(1-t) IR
QP
where t=
QR
Scan
line
x
Q
Illumination Models
Polygon shading: Phong shading
NQ=u NA+(1-u) NB
NR=v NC+(1-v) ND
NR=t NQ+(1-t) NR
It is computationally
more expensive.
Phong