0% found this document useful (0 votes)
9 views35 pages

Graphics16 Illumination

The document discusses the importance of illumination models in computer graphics to create realistic three-dimensional displays. It covers various types of light sources, reflections (diffuse and specular), and introduces a basic illumination model that incorporates ambient light, diffuse reflection, and specular reflection. The document also explains how to calculate light intensity at surface points using these models.

Uploaded by

sanketkingaonkar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views35 pages

Graphics16 Illumination

The document discusses the importance of illumination models in computer graphics to create realistic three-dimensional displays. It covers various types of light sources, reflections (diffuse and specular), and introduces a basic illumination model that incorporates ambient light, diffuse reflection, and specular reflection. The document also explains how to calculate light intensity at surface points using these models.

Uploaded by

sanketkingaonkar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 35

Computer Graphics 16:

Illumination

Course Website: http://www.comp.dit.ie/bmacnamee


2
of
50
Contents
Today we will start to look at illumination
models in computer graphics
– Why do we need illumination models?
– Different kinds of lights
– Different kinds of reflections
– Basic lighting model
3
of
50
Why Lighting?
If we don’t have lighting effects nothing
looks three dimensional!
4
of
50
Why Lighting? (cont…)
-To obtain realistic displays of a scene
natural light effects are applied
-An illumination model or a lighting model or
shading model is used to calculate the
intensity of the light that we should see at a
given point on the surface of an object

-A surface rendering algorithm uses intensity


calculations from illumination model to
determine the light intensity for all pixel
positions for various surfaces in the scene.
5
of
50
Light sources
Light viewed from an opaque nonluminous
surface is in general a combination of
reflected light from a light source and
reflections of light from other sources.

Sometime light sources are referred as light


emitting sources and reflecting surfaces are
termed as light reflecting sources.
6
of
50
Point Light Sources
A point source is the simplest
model we can use for a light
source
We simply define:
– The position of the light
– The RGB values for the colour of the light
Light is emitted in all directions
Useful for small light sources
7
of
50
Reflected Light
The colours that we perceive are determined
by the nature of the light reflected from an
object
For example, if white
light is shone onto a Wh
ite Ligh
green object most t
Colours

wavelengths are Absorbed

L ight
Green
absorbed, while green
light is reflected from
the object
8
of
50
Surface Lighting Effects
The amount of incident light reflected by a
surface depends on the type of material
Shiny materials reflect more of the incident
light and dull surfaces absorb more of the
incident light
For transparent surfaces some of the light is
also transmitted through the material
9
of
50
Diffuse Reflection
Surfaces that are rough or grainy tend to
reflect light in all directions
This scattered light is called diffuse
reflection
10
of
50
Specular Reflection
Additionally to diffuse reflection some of the
reflected light is concentrated into a highlight
or bright spot
This is called specular reflection
11
of
50
Ambient Light
A surface that is not
exposed to direct light
may still be lit up by
reflections from other
nearby objects –
ambient light
The total reflected light
from a surface is the
sum of the contributions
from light
sources and reflected
light
12
of
50
Example
13
of
50
Example

Ambient Diffuse

Final
Specular Image
14
of
50
Basic Illumination Model
We will consider a basic illumination model
which gives reasonably good results and is
used in most graphics systems
The important components are:
– Ambient light
– Diffuse reflection
– Specular reflection
For the most part we will consider only
monochromatic light
15
of
50
Ambient Light
To incorporate background light we simply
set a general brightness level for a scene
This approximates the global diffuse
reflections from various surfaces within the
scene
We will denote this value as Ia
16
of
50
Diffuse Reflection
First we assume that surfaces reflect
incident light with equal intensity in all
directions
Such surfaces are referred to as ideal
diffuse reflectors or Lambertian reflectors
17
of
50
Diffuse Reflection (cont…)

A parameter kd is set for each surface that


determines the fraction of incident light that
is to be scattered as diffuse reflections from
that surface
This parameter is known as the diffuse-
reflection coefficient or the diffuse
reflectivity
kd is assigned a value between 0.0 and 1.0
– 0.0: dull surface that absorbs almost all light
– 1.0: shiny surface that reflects almost all light
18
of
50
Diffuse Reflection – Ambient Light
For background lighting effects we can
assume that every surface is fully
illuminated by the scene’s ambient light Ia
Therefore the ambient contribution to the
diffuse reflection is given as:
I ambdiff k d I a
Ambient light alone is very uninteresting so
we need some other lights in a scene as
well
19
of
50
Diffuse Reflection (cont…)
When a surface is illuminated by a light
source, the amount of incident light depends
on the orientation of the surface relative to
the light source direction
20
of
50
Diffuse Reflection
The angle between the incoming light
Images taken from Hearn & Baker, “Computer Graphics with OpenGL” (2004)

direction and a surface normal is referred to


as the angle of incidence given as θ
21
of
50
Diffuse Reflection (cont…)
So the amount of incident light on a surface
is given as:
I l ,incident I l cos 

So we can model the diffuse reflections as:

I l ,diff k d I l ,incident
k d I l cos 
22
of
50
Diffuse Reflection (cont…)
Assuming we denote the
Images taken from Hearn & Baker, “Computer Graphics with OpenGL” (2004)

normal for a surface as N


and the unit direction
vector to the light source
as L then:
N L cos 
So:
k d I l ( N L) if N L  0
I l ,diff 
 0 if N L 0
23
of
Combining Ambient And Incident Diffuse
50 Reflections
To combine the diffuse reflections arising
from ambient and incident light most
graphics packages use two separate diffuse-
reflection coefficients:
– ka for ambient light
– kd for incident light
The total diffuse reflection equation for a
single point source can then be given as:
k a I a  k d I l ( N L) if N L  0
I diff 
 ka I a if N L 0
24
of
50
Examples
25
of
50
Specular Reflection
The bright spot that we see on a shiny
Images taken from Hearn & Baker, “Computer Graphics with OpenGL” (2004)

surface is the result of near total of the


incident light in a concentrated region
around the specular reflection angle
The specular reflection angle equals the
angle of the incident light
26
of
50
Specular Reflection (cont…)
A perfect mirror reflects light only in the
Images taken from Hearn & Baker, “Computer Graphics with OpenGL” (2004)

specular-reflection direction
Other objects exhibit specular reflections
over a finite range of viewing positions
around vector R
27
of
50
The Phong Specular Reflection Model

The Phong specular reflection model or


Images taken from Hearn & Baker, “Computer Graphics with OpenGL” (2004)

Phong model is an empirical model for


calculating specular reflection range
developed in 1973 by Phong Bui Tuong
The Phong model sets the intensity of
specular reflection as
proportional to the angle
between the viewing
vector and the specular
reflection vector
28
of
The Phong Specular Reflection Model
50 (cont…)
So, the specular reflection intensity is
ns
proportional to cos 
The angle Φ can be varied between 0° and
90° so that cosΦ varies from 1.0 to 0.0
The specular-reflection exponent, ns is
determined by the type of surface we want to
display
– Shiny surfaces have a very large value (>100)
– Rough surfaces would have a value near 1
29
of
The Phong Specular Reflection Model
50 (cont…)
The graphs below show the effect of ns on
Images taken from Hearn & Baker, “Computer Graphics with OpenGL” (2004)

the angular range in which we can expect to


see specular reflections
30
of
The Phong Specular Reflection Model
50 (cont…)
For some materials the amount of specular
reflection depends heavily on the angle of
the incident light
Fresnel’s Laws of Reflection describe in
great detail how specular reflections behave
However, we don’t need to worry about this
and instead approximate the specular
effects with a constant specular reflection
coefficient ks
For an explanation of Fresnel’s laws try here
31
of
The Phong Specular Reflection Model
50 (cont…)
So the specular reflection intensity is given
as:
I l , spec k s I l cos ns 

Remembering that V R cos  we can say:


k s I l (V R ) ns if V R  0 and N L  0
I l , spec 
 0 .0 if V R  0 or N L 0
32
of
50
Example
33
of
Combining Diffuse & Specular
50 Reflections
For a single light source we can combine the
effects of diffuse and specular reflections
simply as follows:
I I diff  I spec
k a I a  k d I l ( N L)  k s I l (V R) ns
34
of
Diffuse & Specular Reflections From
50 Multiple Light Sources
We can place any number of light sources in
a scene
We compute the diffuse and specular
reflections as sums of the contributions from
the various sources
n
 

Exam Question
I I ambdiff   I l ,diff  I l , spec

Common
l 1

 
n
k a I a   I l k d N L  k s V R 
ns

l 1
35
of
50
Summary
T create realistic (or even semi-realistic)
looking scenes we must model light correctly
To successfully model lighting effects we
need to consider:
– Ambient light
– Diffuse reflections
– Specular reflections

You might also like