0% found this document useful (0 votes)
10 views

Lecture333616827Lighting Models

The document discusses lighting models in computer graphics. It covers different types of light sources like ambient light, point light sources, and emissive light. It then describes the ambient light model and how ambient light illuminates all surfaces equally without direction. Finally, it introduces reflection models like diffuse reflection where rough surfaces scatter light equally in all directions, and specular reflection where shiny surfaces reflect light in a particular direction.

Uploaded by

sumayya shaik
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Lecture333616827Lighting Models

The document discusses lighting models in computer graphics. It covers different types of light sources like ambient light, point light sources, and emissive light. It then describes the ambient light model and how ambient light illuminates all surfaces equally without direction. Finally, it introduces reflection models like diffuse reflection where rough surfaces scatter light equally in all directions, and specular reflection where shiny surfaces reflect light in a particular direction.

Uploaded by

sumayya shaik
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 49

Chapter 13

Lighting Models
3D Viewing Pipeline
Primitives
Object space
Modeling Transformation
World space
Viewing Transformation
Camera space

Hidden Surface Removal

Lighting & Shading

3D-Clipping

Projection
Normalized view space
Scan conversion, Hiding
Image space,
July 18, 2023 Computer Graphics Device coordinates 2
Image
Viewing Models
Need for different models
• Light Models: To take care of Light, its intensity and
effect on different textures.
• Shading Models: To take care of type of surface – its
shape, texture etc.
• Colour Models: Various colour schemes present to
represent the calculated intensities on your computer.

July 18, 2023 Computer Graphics 3


Lighting Models
• Lighting Models: If we don’t have lighting effects nothing
looks three dimensional! The RGB values are not sufficient.
• Also known as
– Light Model
– Shading Models
– Illumination Model
• Calculate intensity of light at any
given point.
• Surface rendering algorithms use
these models.

July 18, 2023 Computer Graphics 4


Lighting Models
• We will study
– Light Sources
– Ambient Light Model
– Reflection Models
– Refraction Model
– Texture Surface Patterns
– Displaying Light Intensities

July 18, 2023 Computer Graphics 5


Contents

1. Light Sources
2. Ambient Light Model
3. Reflection Models
4. Refraction Models
5. Texture Surface Patterns
6. Displaying Light Intensities
Light Sources
• How is light scattered or reflected from a surface?
• The amount of light reaching the camera must be calculated.
• In graphics, we typical use several kinds of lights:
– Ambient light
– Point light sources
– Emissive light sources

July 18, 2023 Computer Graphics 7


Light Sources
• 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 Whi
te Ligh
t
green object most Colours
wavelengths are Absorbed

absorbed, while green Green


Ligh t

light is reflected from


the object

July 18, 2023 Computer Graphics 8


Light Sources
• The amount of incident light reflected by a surface
depends on the type of material.
– Shiny materials reflect more of the incident light in
narrow range
– Dull surfaces absorb more of the incident light and
reflection in near uniform over all surface.
– For transparent surfaces some of the light is also
transmitted through the material.
– A luminous object can be both a light source and a light
reflector.

July 18, 2023 Computer Graphics 9


Light Sources
LIGHT-MATERIAL INTERACTION
(a) specular surface
(b) diffuse surface
(c) translucent surface

Contrast
opaque surface vs
translucent surface.

July 18, 2023 Computer Graphics 10


July 18, 2023 Computer Graphics 11
Example

July 18, 2023 Computer Graphics 12


Example

Ambient Diffuse

Final
Specular Image

July 18, 2023 Computer Graphics 13


Basic Light Model
• A Basic Light Model include
– The background light conditions. (Ambient Light)
– A Direct light source specification (Point source) specified as a (x,y)
coordinates with an intensity value and its contribution.
– The Indirect light present in form of reflection or refraction.
– The optical properties of surfaces
• Glassy
• Matte
• Opaque
• Transparent
– For most part we make consider monochrome light source.

July 18, 2023 Computer Graphics 14


Contents

1. Light Sources
2. Ambient Light Model
3. Reflection Models
4. Refraction Models
5. Texture Surface Patterns
6. Displaying Light Intensities
Ambient Light
• Objects not directly lit are typically still visible
– e.g., the ceiling in this room, undersides of desks

• They are lit up by reflections from other nearby


objects – ambient light

• This is the result of indirect illumination


from emitters, bouncing off intermediate surfaces

July 18, 2023 Computer Graphics 16


Real Life Example of Ambient Light

July 18, 2023 Computer Graphics 17


Ambient Light
• A scene lit only with an ambient light source:
Light Position
Not Important

Viewer Position
Not Important

Surface Angle
Not Important

July 18, 2023 Computer Graphics 18


Ambient Light
1. Doesn't come from a particular direction.
2. Has a source, but has bounced around so much to make it is
directionless.
3. Often achieved through large sources that shine through a
diffuser that scatters light in all directions.
4. Affects all polygons independent of their position,
orientation, or viewing angle.
5. Typical examples are light from:
– a cloudy day
– moonlight
– sunlight scattered by fog or haze

July 18, 2023 Computer Graphics 19


Ambient Light
6. The total reflected light from a surface is the sum of the
contributions from light sources and reflected light
7. Too expensive to calculate (in real time), so we use a hack called
an ambient light source
– Since it has no spatial or directional characteristics; illuminates all
surfaces equally
– Amount reflected depends on surface properties
8. To incorporate background light we simply set a general
brightness level for a scene
9. This approximates the global diffuse reflections from various
surfaces within the scene
• We will denote this value as Ia
July 18, 2023 Computer Graphics 20
Contents

1. Light Sources
2. Ambient Light Model
3. Reflection Models
1. Diffuse Reflection
2. Specular Reflection
4. Refraction Models
5. Texture Surface Patterns
6. Displaying Light Intensities
Diffuse Reflection
• Surfaces that are rough or grainy tend to reflect light in all
directions
• This scattered light is called diffuse reflection

July 18, 2023 Computer Graphics 22


Diffuse Light

July 18, 2023 Computer Graphics 23


Diffuse Reflection
• 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
• kd can be built f( surface texture, colour)

July 18, 2023 Computer Graphics 24


Diffuse Reflection
In the presence of 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

July 18, 2023 Computer Graphics 25


Diffuse Reflection
In the presence of Single Point Light Source
• 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

July 18, 2023 Computer Graphics 26


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.
• An ideal diffuse reflector, at the microscopic level, is a very
rough surface (real-world example: chalk)
• Ideal diffuse surfaces reflect according to Lambert’s cosine
law. These are often called Lambertian surfaces.
• Note that the reflected intensity is independent of the viewing
direction, but does depend on the surface orientation with
regard to the light source

July 18, 2023 Computer Graphics 27


Lambert’s Cosine Law
• Ideal diffuse surfaces reflect according to Lambert’s cosine
law:
The radiant energy reflected by a small portion of a surface area A
from a light source in a given direction  is proportional to the cosine
of the angle between that direction and the surface normal.

July 18, 2023 Computer Graphics 28


Diffuse Reflection
• The angle between the incoming light direction and a surface
normal is referred to as the angle of incidence given as θ

July 18, 2023 Computer Graphics 29


Diffuse Reflection
• 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 

July 18, 2023 Computer Graphics 30


Diffuse Reflection
• Assuming we denote the
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

July 18, 2023 Computer Graphics 31


Diffuse Reflection
Combining Ambient And Incident Diffuse 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

July 18, 2023 Computer Graphics 32


Example
• We need only consider angles from 0° to 90° (Why?)
• A Lambertian sphere seen at several different lighting angles:

July 18, 2023 Computer Graphics 33


Example

July 18, 2023 Computer Graphics 34


Contents

1. Light Sources
2. Ambient Light Model
3. Reflection Models
1. Diffuse Reflection
2. Specular Reflection
4. Refraction Models
5. Texture Surface Patterns
6. Displaying Light Intensities
Specular Reflection
• Additionally to diffuse reflection some of the reflected light is
concentrated into a highlight or bright spot
• This is called specular reflection

July 18, 2023 Computer Graphics 36


Specular Reflection
• Shiny surfaces exhibit specular reflection
– Polished metal
– Glossy car finish

• These highlights appear is a function of the viewer’s


position, so specular reflection is view dependent

July 18, 2023 Computer Graphics 37


Specular Reflection
• The bright spot that we see on a shiny surface is the result of
near total of the incident light in a concentrated region around
the specular reflection angle
• Ideal specular reflection angle equals the angle of the
incident light
Unit normal Unit normal
to surface in direction
of ideal
Unit vector
specular
toward light
reflection
source

Unit vector
to viewer

July 18, 2023 Computer Graphics 38


The Phong Specular Reflection Model
• The Phong specular reflection model or 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

July 18, 2023 Computer Graphics 39


The Phong Specular Reflection Model
• A perfect mirror reflects light only in the specular-reflection
direction
• Other objects exhibit specular reflections over a finite range of
viewing positions around vector R

July 18, 2023 Computer Graphics 40


The Phong Specular Reflection Model
• So, the specular reflection intensity is proportional to cos n 
s

• 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

July 18, 2023 Computer Graphics 41


The Phong Specular Reflection Model
• The graphs below show the effect of ns on the angular range in
which we can expect to see specular reflections

July 18, 2023 Computer Graphics 42


The Phong Specular Reflection Model
• 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

July 18, 2023 Computer Graphics 43


The Phong Specular Reflection Model
• 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

July 18, 2023 Computer Graphics 44


Example

July 18, 2023 Computer Graphics 47


Combining Diffuse & Specular
Reflections
• For a single light source we can combine the effects of diffuse
and specular reflections simply as follows:
I  I diff  I spec
 I ambdiff  I L ,diff  I spec
k a I a  k d I l ( N  L)  k s I l (V  R ) ns
N
Viewer R   L

V

July 18, 2023 Computer Graphics 48


Combining Diffuse & Specular
Reflections
• For a single light source we can combine the effects of
diffuse and specular reflections simply as follows:

N
Viewer L1
L2

July 18, 2023 Computer Graphics 49


Combining Diffuse & Specular
Reflections
• For multiple light sources we can place n 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

July 18, 2023 Computer Graphics 50


WIREFRAME MODEL WITH AMBIENT LIGHT

WITH DIFFUSE REFLECTION WITH SPECULAR REFLECTION

July 18, 2023 Computer Graphics 51

You might also like