SlideShare a Scribd company logo
ILLUMINATION MODELS &
SHADING
Prof. Bailappa Bhovi
Department of Computer Engineering
International Institute of Information Technology, I²IT
www.isquareit.edu.in
Illumination Models and Shading
• Light Source Models
• Ambient Illumination
• Diffuse Reflection
• Specular Reflection
• Polygon Rendering Methods
• Flat Shading
• Gouraud Shading
• Phong Shading
Illumination Models
•Motivation: In order to produce realistic images,
we must simulate the appearance of surfaces under
various lighting conditions
•Illumination Model: Given the illumination
incident at a point on a surface, quantifies the
reflected light
Illumination Model Parameters
•Lighting effects are described with models that consider the
interaction of light sources with object surfaces
•The factors determining the lighting effects are:
– The light source parameters:
• Positions
• Electromagnetic Spectrum
• Shape
– The surface parameters
• Position
• Reflectance properties
• Position of nearby surfaces
– The eye (camera) parameters
• Position
• Sensor spectrum sensitivities
Illumination Models and Rendering
•An illumination model is used to calculate the
intensity of the light that is reflected at a given point
on a surface
•A rendering method uses intensity calculations
from the illumination model to determine the light
intensity at all pixels in the image
Light Source Models
• Point Source (a): All light rays originate at a point and
radially diverge. A reasonable approximation for sources
whose dimensions are small compared to the object size
• Parallel source (b): Light rays are all parallel. May be
modeled as a point source at infinite distance (the sun)
• Distributed source (c): All light rays originate at a finite
area in space. It models a nearby source, such as a
fluorescent light
b
a
c
Illumination Models
• Simplified and fast methods for calculating
surfaces intensities, mostly empirical
• Calculations are based on optical properties
of surfaces and the lighting conditions (no
reflected sources nor shadows)
• Light sources are considered to be point
sources
• Reasonably good approximation for most
scenes
Ambient Illumination
• Assume there is some non-directional light
in the environment (background light)
• The amount of ambient light incident on
each object is constant for all surfaces and
over all directions
• Very simple model, not very realistic
• OpenGL default
Ambient Illumination
• The reflected intensity Iamb of any point on the
surface is:
Ia - ambient light intensity
Ka  [0,1] - surface ambient reflectivity
• In principle Ia and Ka are functions of color, sowe
have IR
amb, IG
amb and IB
amb
Iamb = Ka Ia
Ambient Illumination
• Example:
Diffuse Reflection
• Diffuse (Lambertian) surfaces are rough or grainy,
like clay, soil, fabric
• The surface appears
equally bright from all
viewing directions
• The brightness at each
point is proportional to
cos()

N
L
Diffuse Reflection
• Brightness is proportional to cos() because a
surface (a) perpendicular to the light direction is
more illuminated than a surface (b) at an oblique
angle
a b

N
L
Diffuse Reflection
• The reflected intensity Idiff of a point on the
surface is:
Idiff = Kd Ipcos() = Kd Ip(NL)
Ip - the point light intensity. May appear as
attenuated source fatt(r)IP
Kd  [0,1] - the surface diffuse reflectivity
N - the surface normal
L - the light direction
NOTE: If N and L have unitary length: cos() = N  L
Diffuse Reflection
• Example:
Diffuse Reflection
• Example: diffuse reflection from different
light directions
Diffuse Reflection
•Commonly, there are two types of light sources:
– A background ambient light
– A point light source
• The equation that combines the two models is:
I = Idiff + Iamb = Kd Ip NL + Ka Ia
• Note this is the model for one color and it should
be replicated for each channel: IR, IG and IB
Diffuse Reflection
• Example:
0 0.3 0.6
0.3
0.5
0.7
Ka
Kd
Specular Reflection
• Models shiny and glossy surfaces (like metal,
plastic, etc..) with highlights
• Reflectance intensity changes with reflected angle
• An ideal specular surface (mirror) reflects light
exclusively in one direction: R
• Glossy objects are not ideal mirrors and reflect
in the immediate vicinity of R
N
 
L
N
 
R L R
V
Ideal specular surface Non-ideal specular surface
Specular Reflection
• The Phong Model: reflected specular intensity
falls off as some power of cos ():
Ispec = Ks Ipcosn() = Ks Ip(RV)n
 
Ks - the surface specular reflectivity
n – specular reflection parameter, determining
the deviation from ideal specular surface
(for a perfect mirror n=)
N
L R
V
Specular surface
Specular Reflection
• The Phong Model: plots of cosn() for three
values of the specular parameter n
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
0
0.2
0.4
0.6
0.8
1
n=1
n=8
n=64
 
N
L R
V
Specular surface
Specular Reflection
•The illumination equation combined with diffuse
reflection is:
I = Iamb+Idiff+Ispec=
Ka Ia + Ip (Kd NL + Ks(RV)n)
• If k light sources are present in the scene:
diff specI= Iamb+k (Ik +Ik )
Specular Reflection
• Example:
0.2 0.5 0.8
0
0.3
0.7
Kd
Ks
Specular Reflection
• Example: effects of the specular parameter n
n=50
n=10
n=3
Specular Reflection
• Example:
Ambient Illumination
Ambient + Diffuse
Ambient + Diffuse + Specular
Composing Light Sources
• Example:
Polygon Rendering Methods
• A freeform surface can be approximated
by polyhedra
• Rendering: calculate the illumination at
each surface point
• Applying the illumination model at each
surface point is computationally expensive
Flat Shading
• A single intensity is calculated for each surface
polygon
• Fast and simple method
• Gives reasonable result only if all of the following
assumptions are valid:
– The object is a polyhedron
– Light source is far away
from the surface so that
N•L is constant over each
polygon
– Viewing position is far away
from the surface so that V•R
is constant over each polygon
Gouraud Shading
• Renders the polygon surface by linearly
interpolating intensity values across the surface
Gouraud Shading Algorithm:
1. Determine the normal at each polygon vertex
2. Apply an illumination model to each vertex to
calculate the vertex intensity
3. Linearly interpolate the vertex intensities over
the surface polygon
Gouraud Shading
•The normal Nv of a vertex is an average of all
neighboring normals:

k
k
k
 k
V
N
N
N 
Gouraud Shading
2
21
41
1
21
24
4 I
y  y
I 
y  y
I 
2
23
53
3
23
25
5 I
y  y
y  y
I 
y  y
y  y
I 
5
45
4p
4
45
p5
p I
x  x
y  y
x  x
I 
x  x
y  y
x  x
I 
I1
I I4 5
scan line
I2
x
• Interpolation of the vertex intensities
y
I3
IP
Gouraud Shading
• Example: Gouraud shading of a sphere
Phong Shading
•A more accurate method for rendering a
polygon surface is to interpolate normal
vectors, and then apply the illumination
model to each surface point
• Phong Shading Algorithm:
1. Determine the normal at each polygon vertex
2. Linearly interpolate the vertex normals
over the surface polygon
3. Apply the illumination model along each scan
line to calculate intensity of each surface
Phong Shading
• Example: Phong shading of a sphere
Polygon Rendering Methods
• Example:
Flat
Gouraud
Phong
Polygon Rendering Methods
• Example:
Flat
Gouraud
Phong
Polygon Rendering Methods
• Example:
Flat Gouraud
Phong
Thank-You
International Institute of Information Technology
(I²IT)
P-14, Rajiv Gandhi Infotech Park, MIDC Phase – 1,
Hinjawadi, Pune – 411057, India
http://www.isquareit.edu.in/
info@isquareit.edu.in

More Related Content

PPTX
Concept of basic illumination model
PPT
Visible Surface Detection
PPT
Citation And Style Mannuals
PPTX
Output primitives in Computer Graphics
PPTX
2 d viewing computer graphics
PDF
Computer graphics curves and surfaces (1)
PPTX
Computer graphics realism
PPTX
mobile processors
Concept of basic illumination model
Visible Surface Detection
Citation And Style Mannuals
Output primitives in Computer Graphics
2 d viewing computer graphics
Computer graphics curves and surfaces (1)
Computer graphics realism
mobile processors

What's hot (20)

PPT
Visible surface detection in computer graphic
PPTX
Clipping in Computer Graphics
PDF
UNIT-6-Illumination-Models-and-Surface-Rendering-Methods.pdf
PPTX
Depth Buffer Method
PPTX
Polygon filling algorithm
PPTX
Raster animation
PPTX
Raster Scan display
PPTX
Overview of Graphics System
PPT
Composite transformations
PPTX
Color Models Computer Graphics
PPT
Liang barsky Line Clipping Algorithm
PPTX
Halftoning in Computer Graphics
PDF
COLOR CRT MONITORS IN COMPUTER GRAPHICS
PDF
Unit 3
PPTX
Segments in Graphics
PPT
PPTX
Clipping
PPTX
HOMOGENEOUS CO-ORDINATES IN COMPUTER GRAPHICS PPT
PPT
Computer graphics iv unit
PPTX
Hidden surface removal
Visible surface detection in computer graphic
Clipping in Computer Graphics
UNIT-6-Illumination-Models-and-Surface-Rendering-Methods.pdf
Depth Buffer Method
Polygon filling algorithm
Raster animation
Raster Scan display
Overview of Graphics System
Composite transformations
Color Models Computer Graphics
Liang barsky Line Clipping Algorithm
Halftoning in Computer Graphics
COLOR CRT MONITORS IN COMPUTER GRAPHICS
Unit 3
Segments in Graphics
Clipping
HOMOGENEOUS CO-ORDINATES IN COMPUTER GRAPHICS PPT
Computer graphics iv unit
Hidden surface removal
Ad

Similar to Illumination Models & Shading (20)

PPTX
Illumination Models in graphic computer vision and Shading.pptx
PPTX
graphics_Illumenation,texrure And shading.pptx
PPT
Graphics Lecture 7
PPTX
illumination model in Computer Graphics by irru pychukar
PPT
Illumination model
PPT
PPT
Lighting and shading
PDF
Iluminacion
PPT
graphics notes
PDF
Shading
PPT
Use of Specularities and Motion in the Extraction of Surface Shape
PPTX
Object rendering
PPTX
Compututer Graphics - Color Modeling And Rendering
PDF
smallpt: Global Illumination in 99 lines of C++
PPTX
computergrapgichiddensurfacemethodes.pptx
PPT
CS 354 Lighting
PPT
The nature and propagation of light
PDF
3 D texturing
PDF
Physics LIGHTS AND OPTICS description with basics.pptx.pdf
PPT
Paris Master Class 2011 - 07 Dynamic Global Illumination
Illumination Models in graphic computer vision and Shading.pptx
graphics_Illumenation,texrure And shading.pptx
Graphics Lecture 7
illumination model in Computer Graphics by irru pychukar
Illumination model
Lighting and shading
Iluminacion
graphics notes
Shading
Use of Specularities and Motion in the Extraction of Surface Shape
Object rendering
Compututer Graphics - Color Modeling And Rendering
smallpt: Global Illumination in 99 lines of C++
computergrapgichiddensurfacemethodes.pptx
CS 354 Lighting
The nature and propagation of light
3 D texturing
Physics LIGHTS AND OPTICS description with basics.pptx.pdf
Paris Master Class 2011 - 07 Dynamic Global Illumination
Ad

More from International Institute of Information Technology (I²IT) (20)

PPTX
Understanding Natural Language Processing
PPTX
Professional Ethics & Etiquette: What Are They & How Do I Get Them?
PPTX
Writing Skills: Importance of Writing Skills
PPTX
Professional Communication | Introducing Oneself
PPTX
PPTX
What Is Jenkins? Features and How It Works
PPTX
Data Science, Big Data, Data Analytics
PPTX
PPTX
Difference Between AI(Artificial Intelligence), ML(Machine Learning), DL (Dee...
PPTX
Sentiment Analysis in Machine Learning
PPT
Importance of Theory of Computations
PPT
Java as Object Oriented Programming Language
PPTX
PPTX
Data Visualization - How to connect Microsoft Forms to Power BI
Understanding Natural Language Processing
Professional Ethics & Etiquette: What Are They & How Do I Get Them?
Writing Skills: Importance of Writing Skills
Professional Communication | Introducing Oneself
What Is Jenkins? Features and How It Works
Data Science, Big Data, Data Analytics
Difference Between AI(Artificial Intelligence), ML(Machine Learning), DL (Dee...
Sentiment Analysis in Machine Learning
Importance of Theory of Computations
Java as Object Oriented Programming Language
Data Visualization - How to connect Microsoft Forms to Power BI

Recently uploaded (20)

PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PPTX
additive manufacturing of ss316l using mig welding
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PDF
PPT on Performance Review to get promotions
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PPTX
bas. eng. economics group 4 presentation 1.pptx
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PDF
Digital Logic Computer Design lecture notes
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PDF
Structs to JSON How Go Powers REST APIs.pdf
PPTX
OOP with Java - Java Introduction (Basics)
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PDF
Well-logging-methods_new................
PPTX
Welding lecture in detail for understanding
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
Lesson 3_Tessellation.pptx finite Mathematics
additive manufacturing of ss316l using mig welding
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPT on Performance Review to get promotions
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
bas. eng. economics group 4 presentation 1.pptx
Operating System & Kernel Study Guide-1 - converted.pdf
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Digital Logic Computer Design lecture notes
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Structs to JSON How Go Powers REST APIs.pdf
OOP with Java - Java Introduction (Basics)
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Well-logging-methods_new................
Welding lecture in detail for understanding
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Embodied AI: Ushering in the Next Era of Intelligent Systems

Illumination Models & Shading

  • 1. ILLUMINATION MODELS & SHADING Prof. Bailappa Bhovi Department of Computer Engineering International Institute of Information Technology, I²IT www.isquareit.edu.in
  • 2. Illumination Models and Shading • Light Source Models • Ambient Illumination • Diffuse Reflection • Specular Reflection • Polygon Rendering Methods • Flat Shading • Gouraud Shading • Phong Shading
  • 3. Illumination Models •Motivation: In order to produce realistic images, we must simulate the appearance of surfaces under various lighting conditions •Illumination Model: Given the illumination incident at a point on a surface, quantifies the reflected light
  • 4. Illumination Model Parameters •Lighting effects are described with models that consider the interaction of light sources with object surfaces •The factors determining the lighting effects are: – The light source parameters: • Positions • Electromagnetic Spectrum • Shape – The surface parameters • Position • Reflectance properties • Position of nearby surfaces – The eye (camera) parameters • Position • Sensor spectrum sensitivities
  • 5. Illumination Models and Rendering •An illumination model is used to calculate the intensity of the light that is reflected at a given point on a surface •A rendering method uses intensity calculations from the illumination model to determine the light intensity at all pixels in the image
  • 6. Light Source Models • Point Source (a): All light rays originate at a point and radially diverge. A reasonable approximation for sources whose dimensions are small compared to the object size • Parallel source (b): Light rays are all parallel. May be modeled as a point source at infinite distance (the sun) • Distributed source (c): All light rays originate at a finite area in space. It models a nearby source, such as a fluorescent light b a c
  • 7. Illumination Models • Simplified and fast methods for calculating surfaces intensities, mostly empirical • Calculations are based on optical properties of surfaces and the lighting conditions (no reflected sources nor shadows) • Light sources are considered to be point sources • Reasonably good approximation for most scenes
  • 8. Ambient Illumination • Assume there is some non-directional light in the environment (background light) • The amount of ambient light incident on each object is constant for all surfaces and over all directions • Very simple model, not very realistic • OpenGL default
  • 9. Ambient Illumination • The reflected intensity Iamb of any point on the surface is: Ia - ambient light intensity Ka  [0,1] - surface ambient reflectivity • In principle Ia and Ka are functions of color, sowe have IR amb, IG amb and IB amb Iamb = Ka Ia
  • 11. Diffuse Reflection • Diffuse (Lambertian) surfaces are rough or grainy, like clay, soil, fabric • The surface appears equally bright from all viewing directions • The brightness at each point is proportional to cos()  N L
  • 12. Diffuse Reflection • Brightness is proportional to cos() because a surface (a) perpendicular to the light direction is more illuminated than a surface (b) at an oblique angle a b  N L
  • 13. Diffuse Reflection • The reflected intensity Idiff of a point on the surface is: Idiff = Kd Ipcos() = Kd Ip(NL) Ip - the point light intensity. May appear as attenuated source fatt(r)IP Kd  [0,1] - the surface diffuse reflectivity N - the surface normal L - the light direction NOTE: If N and L have unitary length: cos() = N  L
  • 15. Diffuse Reflection • Example: diffuse reflection from different light directions
  • 16. Diffuse Reflection •Commonly, there are two types of light sources: – A background ambient light – A point light source • The equation that combines the two models is: I = Idiff + Iamb = Kd Ip NL + Ka Ia • Note this is the model for one color and it should be replicated for each channel: IR, IG and IB
  • 17. Diffuse Reflection • Example: 0 0.3 0.6 0.3 0.5 0.7 Ka Kd
  • 18. Specular Reflection • Models shiny and glossy surfaces (like metal, plastic, etc..) with highlights • Reflectance intensity changes with reflected angle • An ideal specular surface (mirror) reflects light exclusively in one direction: R • Glossy objects are not ideal mirrors and reflect in the immediate vicinity of R N   L N   R L R V Ideal specular surface Non-ideal specular surface
  • 19. Specular Reflection • The Phong Model: reflected specular intensity falls off as some power of cos (): Ispec = Ks Ipcosn() = Ks Ip(RV)n   Ks - the surface specular reflectivity n – specular reflection parameter, determining the deviation from ideal specular surface (for a perfect mirror n=) N L R V Specular surface
  • 20. Specular Reflection • The Phong Model: plots of cosn() for three values of the specular parameter n -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 0 0.2 0.4 0.6 0.8 1 n=1 n=8 n=64   N L R V Specular surface
  • 21. Specular Reflection •The illumination equation combined with diffuse reflection is: I = Iamb+Idiff+Ispec= Ka Ia + Ip (Kd NL + Ks(RV)n) • If k light sources are present in the scene: diff specI= Iamb+k (Ik +Ik )
  • 22. Specular Reflection • Example: 0.2 0.5 0.8 0 0.3 0.7 Kd Ks
  • 23. Specular Reflection • Example: effects of the specular parameter n n=50 n=10 n=3
  • 24. Specular Reflection • Example: Ambient Illumination Ambient + Diffuse Ambient + Diffuse + Specular
  • 26. Polygon Rendering Methods • A freeform surface can be approximated by polyhedra • Rendering: calculate the illumination at each surface point • Applying the illumination model at each surface point is computationally expensive
  • 27. Flat Shading • A single intensity is calculated for each surface polygon • Fast and simple method • Gives reasonable result only if all of the following assumptions are valid: – The object is a polyhedron – Light source is far away from the surface so that N•L is constant over each polygon – Viewing position is far away from the surface so that V•R is constant over each polygon
  • 28. Gouraud Shading • Renders the polygon surface by linearly interpolating intensity values across the surface Gouraud Shading Algorithm: 1. Determine the normal at each polygon vertex 2. Apply an illumination model to each vertex to calculate the vertex intensity 3. Linearly interpolate the vertex intensities over the surface polygon
  • 29. Gouraud Shading •The normal Nv of a vertex is an average of all neighboring normals:  k k k  k V N N N 
  • 30. Gouraud Shading 2 21 41 1 21 24 4 I y  y I  y  y I  2 23 53 3 23 25 5 I y  y y  y I  y  y y  y I  5 45 4p 4 45 p5 p I x  x y  y x  x I  x  x y  y x  x I  I1 I I4 5 scan line I2 x • Interpolation of the vertex intensities y I3 IP
  • 31. Gouraud Shading • Example: Gouraud shading of a sphere
  • 32. Phong Shading •A more accurate method for rendering a polygon surface is to interpolate normal vectors, and then apply the illumination model to each surface point • Phong Shading Algorithm: 1. Determine the normal at each polygon vertex 2. Linearly interpolate the vertex normals over the surface polygon 3. Apply the illumination model along each scan line to calculate intensity of each surface
  • 33. Phong Shading • Example: Phong shading of a sphere
  • 34. Polygon Rendering Methods • Example: Flat Gouraud Phong
  • 35. Polygon Rendering Methods • Example: Flat Gouraud Phong
  • 36. Polygon Rendering Methods • Example: Flat Gouraud Phong
  • 37. Thank-You International Institute of Information Technology (I²IT) P-14, Rajiv Gandhi Infotech Park, MIDC Phase – 1, Hinjawadi, Pune – 411057, India http://www.isquareit.edu.in/ info@isquareit.edu.in