Computer Graphics
2 2
Chapter 14
Chapter 14
Illumination Models & Surface-Rendering
Illumination Models & Surface-Rendering
Methods
Methods
Computer Graphics
Chapter 14
Chapter 14
Illumination Models & Surface-Rendering
Illumination Models & Surface-Rendering
Methods
Methods
Computer Graphics
3 3
Illumination Models &
Illumination Models &
Surface-Rendering Methods
Rendering Methods
••
Illumination
Illumination model
model
or a
or a
lighting model
lighting model
is
is
the model for calculating light intensity at a
the model for calculating light intensity at a
single surface point.
single surface point.
••
Surface rendering
Surface rendering
is a procedure for
is a procedure for
applying a lighting model to obtain piel
applying a lighting model to obtain piel
intensities for all the pro!ected surface
intensities for all the pro!ected surface
positions in a scene.
Surface rendering
Surface rendering
•• Surface rendering can be performed by applying Surface rendering can be performed by applying thethe illumination model to e#ery #isible surface point$ or illumination model to e#ery #isible surface point$ or the rendering can be accomplished by interpolating the rendering can be accomplished by interpolating intensities across the surface from a small set of
intensities across the surface from a small set of illumination-model calculations.
illumination-model calculations.
•• Scan-line algorithms use interpolation schemes.Scan-line algorithms use interpolation schemes. •• Ray tracing algorithms in#o%e the illuminationRay tracing algorithms in#o%e the illumination
model at each piel position. model at each piel position.
•• Surface-rendering procedures are termedSurface-rendering procedures are termed surface- surface-shading methods
Illumination models
'i#en the parameters(• the optical properties of surfaces
)opa*ue+transparent$ shiny+dull$ surface-teture, • the relati#e positions of the surfaces in a scene • the color and positions of the light sources
• the position and orientation of the #ieing plane. Illumination models calculate the intensity pro!ected
from a particular surface point in a specified #ieing direction.
0ecture lane
• 0ight Sources
• asic Illumination Models
mbient 0ight
4iffuse Reflection
Specular Reflection & hong Model
5ombine 4iffuse & Specular Reflections
ith Multiple 0ight Sources
6
0ight Sources
• 7hen e #ie an opa*ue nonluminous ob!ect$ e see reflected light from the surfaces of the ob!ect. • 8he total reflected light is the sum of the
contributions from light sources and other reflecting surfaces in the scene.
• 0ight sources 9 light-emitting sources.
0ight Sources
0ight Source Reflecting Surfaces Fig. 10ight #ieed from an opa*ue surface is in general a combination of reflected light from a light source and reflections of light reflections from other surfaces.
;
oint 0ight Source
• 8he rays emitted from a pointlight radially di#erge from the source.
• pproimation for sources that are small compared to
the si<e of ob!ects in the scene.
• point light source is a fair approimation to a local light source such as a light bulb.
• 8he direction of the light to each point on a
surface changes hen a point light source is used.
Fig. 2
4istributed 0ight Source
• nearby source$ such asthe long fluoresent light. • ll of the rays from a
directional+distributed light source ha#e the same direction$ and no point of origin.
• It is as if the light source as infinitely far aay from the surface that it is illuminating.
• Sunlight is an eample of an infinite light source.
Fig. 3
11
Materials
• 7hen light is incident on an opa*ue
surface$ part of it is reflected and part is
absorbed.
• Shiny materials reflect more of the incident
light$ and dull surface absorb more of the
incident light.
• >or an illuminated transparent surface$
some of the incident light ill be reflected
and some ill be transmitted through the
material.
4iffuse reflection
• 'rainy surfaces scatter the reflected light in all directions. 8his scattered light is called diffuse reflection.
• 8he surface appears e*ually bright from all #ieing directions.
• 7hat e call the color of an ob!ect is the color of the diffuse reflection of the incident light.
Fig. 4
13
Specular reflection
• 0ight sources create highlights$ bright spots$
called
specular reflection
. More
pronounced on shiny surfaces than on dull.
Fig. 5
asic Illumination Models
0ighting calculations are based on(
• ?ptical properties of surfaces$ such as
glossy$ matte$ opa*ue$ and transparent. 8his
controls the amount of reflection and
absorption of incident light.
• 8he bac%ground lighting conditions.
• 8he light-source specifications. ll light
sources are considered to be point sources$
specified ith a coordinate position and
1
mbient 0ight
• @#en though an ob!ect in a scene is not directly lit it ill still be #isible. 8his is because light is reflected from nearby ob!ects. • mbient light has no spatial or
directional characteristics.
• 8he amount of ambient light incident on each ob!ect is a constant for all surfaces and o#er all directions.
• 8he amount of ambient light that is reflected by an ob!ect is independent of the ob!ects position or orientation and depends only on the optical properties of the surface.
Fig. 6
mbient 0ight
• 8he le#el of ambient light in a scene is a parameter I a $ and each surface illuminated ith this constant
#alue.
• Illumination e*uation for ambient light is I 9 k a I a
here
I is the resulting intensity
I a is the incident ambient light intensity k a is the ob!ectAs basic intensity$ ambient-reflection coefficient .
16
1:
4iffuse Reflection
• 4iffuse reflections are constant o#er each surface in a scene$ independent of the #ieing direction.
• 8he amount of the incident light that is diffusely
reflected can be set for each surface ith parameter k d $ the diffuse-reflection coefficient $ or diffuse
reflectivity. = ≤ k d ≤ 1
k d near 1 B highly reflecti#e surface
k d near = B surface that absorbs most of the incident light
1;
4iffuse Reflection
@#en though there is e*ual light scattering in all direction from a surface$ the brightness of the surface does depend on the orientation of the surface relati#e to the light
source(
)a, )b,
Fig. 8
surface perpendicular to the direction of t he incident light )a, is more illuminated than an e*ual-si<ed surface at an obli*ue angle )b, to the incoming light direction.
4iffuse Reflection
• s the angle beteen the surface normal
and the incoming light direction increases$
les of the incident light falls on the surface.
• 7e denote the
angle of incidence
beteen
the incoming light direction and the surface
normal as
θ. 8hus$ the amount of
illumination depends on cos
θ. If the
incoming light from the source is
perpendicular to the surface at a particular
point$ that point is fully illuminated.
21
4iffuse Reflection
If I l is the intensity of the point
0ight source$ then the diffuse reflection e*uation for a point on the surface can be ritten as
I l,diff 9 k d I l cosθ
or
I l,diff 9 k d I l )C.0,
here
N is the unit normal #ector to a surface and L is the
unit direction #ector to the point light source from a position on the surface.
Fig. 9
ngle of incidenceθ beteen the unit light-source
direction #ectorL and the unit surface normal N.
N L
8o 0ight Source
4iffuse Reflection
>igure 1= illustrates the illumination ith
diffuse reflection$ using #arious #alues of
parameter k
dbeteen = and1.
Fig. 10
23
4iffuse Reflection
7e can combine the ambient and point-source
intensity calculations to obtain an epression for the total diffuse reflection.
I diff 9 k a I a+k d I l )N.L,
here both k a and k d depend on surface material
properties and are assigned #alues in the range from = to 1.
Fig. 11
Series of pictures of sphere illuminated by ambient and diffuse reflection model. I a 9 I l 9 1.=$ k d 9 =." and k a #alues )=.=$ =.1$ =.3=$ =."$ =./=,.
2
Specular Reflection and the
hong Model
• Specular reflection is the result of total$ or near total$
reflection of the incident light in a concentrated region
around the specular-reflection angle.
• Shiny surfaces ha#e a narro specular-reflection range. • 4ull surfaces ha#e a ider reflection range.
Specular Reflection
>igure 13 shos the specular reflectiondirection at a point on the
illuminated surface. In this figure$ • R represents the unit #ector in
the direction of specular reflection • L B unit #ector directed toard the
point light source
• B unit #ector pointing to the #ieer from the surface position • ngle Φ is the #ieing angle relati#e to the specular-reflection
direction R .
Fig. 13
Modeling specular reflection.
N L 8o 0ight Source θ θ R Φ
26
hong Model
Phong model is an empirical model for calculating the specular-reflection range(
• Sets the intensity of specular reflection proportional to cosnsΦ
• ngle Φ assigned #alues in the range =o to ;=o$ so that
cosΦ #alues from = to 1
• Specular-reflection parameter n s is determined by the type of surface$
• Specular-reflection coefficient k s e*ual to some #alue in the range = to 1 for each surface.
hong Model
• Dery shiny surface is modeled ith a large #alue for n s
)say$ 1== or more,
• Small #alues are used for duller surfaces.
• >or perfect reflector )perfect mirror,$ n s is infinite
N L
R
Shiny Surface )0arge n s,
N L R 4ull Surface )Small n s, Fig. 14
2;
hong Model
cosnsΦ
Φ
Fig. 15
lots of cosnsΦ for se#eral #alues of specular parameter n s.
hong Model
hong specular-reflection model(
I
spec9 k
sI
lcos
nsΦSince
and
R
are unit
#ectors in the #ieing
and specular-reflection
directions$ e can
calculate the #alue of
cos
nsΦith the dot
product
.R
.
I
spec9 k
sI
l)
.R
,
nsFig. 13
Modeling specular reflection.
N L 8o 0ight Source θ θ R Φ
31
hong Model
R E 0 9 )2C
.0,C
R 9 )2C
.0,C-0
N L R N.L L Fig. 16hong Model
N L R Φ Fig. 17Falfay #ector! along the bisector of the angle beteen L and.
!
α
9
Φ/ 2
F 9 )0 E D,+G)0 E D,G
I
spec9 k
sI
l)
N
.!
,
ns33