ILLUMINATION
ILLUMINATION (LIGHTING)
ILLUMINATION MODEL
A illumination model usually considers:
Light attributes (light intensity, color, position, direction,
shape)
Object surface attributes (color, reflectivity, transparency, etc) Interaction among lights and objects (object orientation)
Interaction between objects and eye (viewing dir.)
3
ILLUMINATION CALCULATION
Local illumination:
only consider the light,the observer position, and the object material properties
ILLUMINATION MODELS
Global illumination:
take into account theinteraction of light from all the surfaces in the scene
object 1
object 2 object 3
object 4
5
BASIC LIGHT SOURCES
Point light Directional light
Light intensity can be independent or dependent of the distance between object and the light source
SIMPLE LOCAL ILLUMINATION
It considers three types of light contribution to
compute the final illumination of an object
Ambient
Diffuse
Specular
Final illumination of a point (vertex)
Illumination= ambient + diffuse + Specular
7
AMBIENT LIGHT CONTRIBUTION
Ambient light (background light): the combination of light reflections
from various surfaces in the surroundings yields to a uniform illumination called ambient light or background light
very simple approximation of global illumination
Independent of the light position, object orientation, observer’s
position or orientation – ambient light has no direction
object 1
object 2 object 3
AMBIENT LIGHTING EXAMPLE
9
Different objects can reflect different amounts of ambient
(different ambient reflection coefficient Ka, 0 <= Ka <= 1)
So the amount of ambient light that can be seen from an
object is:
IAmbient = Ia x Ka
Ia incident ambient light intensity
Ka ambient diffuse reflection constant IAmbient reflected ambient light
The character of light reflected from a surface depends on the composition( i.e. monochromatic or achromatic),
1. direction and geometry of the light source 2. surface orientation and the
3. surface properties of the object.
They are of two types
1. Diffuse Reflection 2. Specular Reflection
11
DIFFUSE LIGHT CONTRIBUTION
Diffuse light: The illumination that a surface receives from a light
source and reflects equally in all direction
Diffuse reflection is the reflection of light from an uneven or granular
surface such that an incident ray is seemingly reflected at a number of angles. It is the complement to specular reflection. If a surface is
completely non-specular, the reflected light will be evenly spread over the hemisphere surrounding the surface
DIFFUSE LIGHTING EXAMPLE
13
DIFFUSE LIGHT CALCULATION
Need to decide how much light the object point
receive from the light source – based on Lambert’s Law
DIFFUSE LIGHT CALCULATION (2)
Lambert’s law: the radiant energy D that a
small surface patch receives from a light source is:
D = I x cos (q)
I: light intensity
q: angle between the light vector and the surface normal
N : surface normal
light vector (vector from object to light)
q
15
Like the ambient light case, different objects can reflect
different amount of diffuse light (different diffuse reflection coefficient Kd, 0 <= Kd <= 1))
So, the amount of diffuse light that can be seen is:
IDiffuse = Kd I cos (q) Or
IDiffuse = Kd I (N.L)
Diffuse light calculation (3)
q q
N
L cos(q) = N.L
SPECULAR LIGHT CONTRIBUTION
The bright spot on the object
The result of total reflection of the incident light in a concentrate region.
See nothing!
17
Nihar Ranjan Roy
SPECULAR LIGHT CALCULATION
How much reflection you can see
depends on where you are
The only position the eye can see specular from P if the object has an ideal reflection surface
But for a non-perfect surface you will
still see specular highlight when you move a little bit away from the ideal reflection Direction
q q
p
f
19
Nihar Ranjan Roy
PHONG MODEL FOR SPECULAR REFLECTION
The angle φ is the viewing angle relative to the specular reflection direction.
For mirrors (perfect reflector ) φ=0
Acoording to Phong
Ispec ∞ 𝒄𝒐𝒔𝒏𝒔(φ)
φ can be between 0 to 90
Cos(φ) could be between 0 to 1
ns specular-reflection parameter is determined by the type of
The intensity of specular reflection Ispec depends on
― Material properties of the surface
― Angle of incidence
― Polarization and color of the light
Let W(θ)=specular reflection coefficients
W(θ) tends to increase as the angle of incidence increases at θ=90 W(θ)=1 and all incidence light is reflected
The variation of specular intensity with angle of incidence is described by Fresnels Laws of
Reflection.
Nihar Ranjan Roy
Ispecular = W(θ).I .cosns(f)
W(θ): specular reflection coefficient I: light intensity
f: angle between V and R ie viewing angle relative to specular reflection direction R
N: surface normal at P
cosn(f): the larger is n, the smaller is the cos value
cos(f) = V.R
I
specular= K
S.I .(V.R)
nsPHONG SPECULAR REFLECTION MODEL
q q
p f
Viewing
Reflection N
SPECULAR LIGHT CALCULATION (3)
The effect of ‘n’ in the phong model
n = 10
n = 30
n = 90
n = 270
23
Transparent materials, such as glass, only exhibit appreciable specular reflections as θ approaches 90°. At θ = O°, about 4 percent of the
incident light on a glass surface is reflected.
For most of the range of θ the reflected intensity is less than 10 percent of the incident intensity.
For many opaque materials, specular reflection is nearly constant for all incidence angles.
In this case, we can reasonably model the reflected light effects by replacing W(θ) with a constant specular-reflection coefficient ks.
Ispecular = W(θ).I .cosns(f)
Ispecular = KS.I .(V.R)ns
q q
Viewing
Reflection N
SUMMARY OF THE PHONG MODEL
Light sources are assumed to be point sources
Light sources and viewer are located at infinity
Only the normal vector of a surface needs to be computed
The diffuse and specular terms are modeled as local
components
The color of the specular reflection is assumed to be
that of the light source
ks is set to be a constant value independent of the surface
color
The global term(ambient) is modeled as a constant
Drawback:
For a single point source of light total reflection is combine of diffuse and specular
I=Idiff+Ispec
Illumination =ambient Light Ref+diffuse ref+specular Ref
Illumination=IaKa+Ia(Kd (N.L)+Ks (N.H)ns)
Where
Ia=ambient Light
Ka,Kd,Ks are reflection Coefficients o<=ka,ks,kd<=1
If there are N lights
Total illumination for a point
COMBINED APPROACH
)]
)
(N.H
K
)
.
(
(K
[I
K
I
n ns
INTENSITY ATTENUATION
As radiant energy from a point light source travels through
space, its amplitude is attenuated by the factor l/d2, where d is
the distance that the light has traveled.
Problem with our point light source
Does not always produce realistic pictures, if we use the factor
l/
d2 to attenuate intensities
The factor l/d2 produces too much intensity variations when d is small, and it produces very little variation when d is large. This is because real scenes
are usually not illuminated with point light sources.
Solution
Nihar Ranjan Roy
coefficients a0,a1 and a2 can be varied to obtain a variety of lighting effects for a scene.
We can limit the attenuation function to 1 by the following expression
Thus our basic illumination model becomes
Where di is the distance traveled by the light from source i
2 2 1 0
1
)
(
d
a
d
a
a
d
f
)
1
,
1
min(
)
(
2 2 10
a
d
a
d
COLOR CONSIDERATION
Yet in our illumination model we have considered white light.
In order to consider color we should have the intensity equations in terms of color properties of light sources and object surfaces.
For RGB model lets say kdr, kdg kdb be the diffuse coefficients of R G & B components.
for a blue surface object kdr =kdg =0
Nihar Ranjan Roy
29 )] ) (N.H K ) . ( [(K )I f(d K I I n 1 i n i sbi abi i ab ab
B
s
N L i
In specular-reflection model, Phong set parameter k, to a
constant value independent of the surface color. This produces specular reflections that are the same color as the incident light (usually white), which gives the surface a plastic appearance.
For a non-plastic material, the color of the specular reflection is a
function of the surface properties and may be different from both the color of the incident light and the color of the diffuse reflections.
We can approximate specular effects on such surfaces by making
Another method for setting surface color
specify the components of diffuse and specular color vector for
each surface, while retaining the reflectivity coefficients as single-valued constants.
For an RGB color representation, for instance, the
components of these two surface color vectors can be denoted as (SdR,SdC, SdB) and (SIR, SrC, SIB).
The blue component of the reflected light is then calculated as
Nihar Ranjan Roy
31 ] ) (N.H S K ) . ( S [K I (d) f K I I n 1 i ns i sB s dB lBi i a aB B
SdB d N Li
Other color approaches
represent any component of a color specification with its spectral wavelength λ.
Intensity can be represented through
n 1 i ns i s s d i li
(d)
I
[K
S
(
.
)
K
S
(N.H
)
]
f
K
aS
dI
a dN
L
iTRANSPARENCY
A transparent surface, in general, produces both reflected and transmitted light. The relative
contribution of the transmitted light depends on the degree of transparency.
When a transparent surface is to be modeled, the intensity equations must be modified to include
contributions from light passing through the surface In most cases, the transmitted light is generated from
reflecting objects in back of the surface
Nihar Ranjan Roy
Realistic transparency effects are modeled by
considering light refraction.
When light is incident upon a transparent surface,
part of it is reflected and part is refracted.
The direction of the refracted light specified by the
angle of refraction, is a function of the index of
refraction of each material and the direction of the incident light.
Index of refraction for a material is defined as the ratio
Angle of refraction θr, is calculated from the angle of incidence θi, the index of refraction ηi of the "incident" material (usually air), and the index of refraction ηr of the refracting material according to
Sneil's law:
We can combine the transmitted intensity ITrans
through a surface from a background object with the reflected intensity Ireflec from the transparent surface using a transparency coefficient kt We assign
parameter kt a value between 0 and 1 to specify how much of the background light is to be transmitted. Total surface intensity is then calculated as
Nihar Ranjan Roy
35 ) sin( ) sin( i r i
r q
WARN MODEL
So far we have considered only point light sources.
The Warn model provides a method for simulating studio lighting effects by
controlling light intensity in different directions.
Light sources are modelled as points on a reflecting surface, using the Phong
model for the surface points.
Then the intensity in different directions is controlled by selecting values for the
Phong exponent
In addition, light controls,such as "barn doors" and spotlighting, used by studio
photographers can be simulated in the Warn model.
Flaps are used to control the amount of light emitted by a source In various
directions. Two flaps are provided for each of the x, y, and z directions.
Spotlights are used to control the amount of light emitted within a cone with