SlideShare a Scribd company logo
1 of 18
Shading I
1
Objectives
• Learn to shade objects so their images appear three-dimensional
• Introduce the types of light-material interactions
• Build a simple reflection model---the Phong model--- that can be
used with real time graphics hardware
2
Why we need shading
• Suppose we build a model of a sphere using many polygons and color
it with glColor. We get something like
• But we want
3
Shading
•Why does the image of a real sphere look like
•Light-material interactions cause each point to have a
different color or shade
•Need to consider
• Light sources
• Material properties
• Location of viewer
• Surface orientation
4
Scattering
• Light strikes A
• Some scattered
• Some absorbed
• Some of scattered light strikes B
• Some scattered
• Some absorbed
• Some of this scattered
light strikes A
and so on
5
Rendering Equation
• The infinite scattering and absorption of light can be described by the
rendering equation
• Cannot be solved in general
• Ray tracing is a special case for perfectly reflecting surfaces
• Rendering equation is global and includes
• Shadows
• Multiple scattering from object to object
6
Global Effects
7
translucent surface
shadow
multiple reflection
Local vs Global Rendering
• Correct shading requires a global calculation involving all objects and
light sources
• Incompatible with pipeline model which shades each polygon independently
(local rendering)
• However, in computer graphics, especially real time graphics, we are
happy if things “look right”
• Exist many techniques for approximating global effects
8
Light-Material Interaction
•Light that strikes an object is partially absorbed
and partially scattered (reflected)
•The amount reflected determines the color and
brightness of the object
• A surface appears red under white light because the red component of the light
is reflected and the rest is absorbed
•The reflected light is scattered in a manner that
depends on the smoothness and orientation of
the surface
9
Light Sources
General light sources are difficult to work with because we must
integrate light coming from all points on the source
10
Simple Light Sources
• Point source
• Model with position and color
• Distant source = infinite distance away (parallel)
• Spotlight
• Restrict light from ideal point source
• Ambient light
• Same amount of light everywhere in scene
• Can model contribution of many sources and reflecting surfaces
11
Surface Types
•The smoother a surface, the more reflected light is
concentrated in the direction a perfect mirror would
reflected the light
•A very rough surface scatters light in all directions
12
smooth surface rough surface
Phong Model
•A simple model that can be computed rapidly
•Has three components
• Diffuse
• Specular
• Ambient
•Uses four vectors
• To source
• To viewer
• Normal
• Perfect reflector
13
Ideal Reflector
• Normal is determined by local orientation
• Angle of incidence = angle of relection
• The three vectors must be coplanar
14
r = 2 (l · n ) n - l
Lambertian Surface
• Perfectly diffuse reflector
• Light scattered equally in all directions
• Amount of light reflected is proportional to the vertical component
of incoming light
• reflected light ~cos θi
• cos θi = l · n if vectors normalized
• There are also three coefficients, kr, kb, kg that show how much of each color
component is reflected
15
Specular Surfaces
•Most surfaces are neither ideal diffusers nor perfectly
specular (ideal reflectors)
•Smooth surfaces show specular highlights due to
incoming light being reflected in directions
concentrated close to the direction of a perfect
reflection
16
specular
highlight
Modeling Specular Relections
• Phong proposed using a term that dropped off as the angle between
the viewer and the ideal reflection increased
17
φ
Ir ~ ks I cosα
φ
shininess coef
absorption coef
incoming intensity
reflected
intensity
The Shininess Coefficient
•Values of α between 100 and 200 correspond to
metals
•Values between 5 and 10 give surface that look like
plastic
18
cosα
φ
φ 90-90

More Related Content

What's hot

Optics mirrors & lenses
Optics mirrors & lensesOptics mirrors & lenses
Optics mirrors & lensesShamim Ahmed
 
Graphics Lecture 7
Graphics Lecture 7Graphics Lecture 7
Graphics Lecture 7Saiful Islam
 
Optic, lens and iol
Optic, lens and iolOptic, lens and iol
Optic, lens and iolPo Lindara
 
Mirrors and lenses
Mirrors and lensesMirrors and lenses
Mirrors and lensessbarkanic
 
optics mirrors_and_lenses (1)
optics mirrors_and_lenses (1)optics mirrors_and_lenses (1)
optics mirrors_and_lenses (1)Rochell Hilarzo
 
Details About microscope (power Point)
Details About  microscope (power Point)Details About  microscope (power Point)
Details About microscope (power Point)pugazhkurianc
 
The microscope and its historical development
The microscope and its historical developmentThe microscope and its historical development
The microscope and its historical developmentArmand Anthony
 
Optics basics concepts
Optics basics conceptsOptics basics concepts
Optics basics conceptsAnisur Rahman
 
Notes on Optics
Notes on OpticsNotes on Optics
Notes on Opticsdolandese
 
Microscope parts and functions
Microscope parts and functionsMicroscope parts and functions
Microscope parts and functionsjoevani_007
 
Geometrical Optics Introduction
Geometrical Optics IntroductionGeometrical Optics Introduction
Geometrical Optics IntroductionRabia Ammer
 
Condensers microscope/cosmetic dentistry courses
Condensers microscope/cosmetic dentistry coursesCondensers microscope/cosmetic dentistry courses
Condensers microscope/cosmetic dentistry coursesIndian dental academy
 
The nature and propagation of light
The nature and propagation of lightThe nature and propagation of light
The nature and propagation of lightJessabeth Aluba
 

What's hot (18)

Ray tracing
 Ray tracing Ray tracing
Ray tracing
 
Optics mirrors & lenses
Optics mirrors & lensesOptics mirrors & lenses
Optics mirrors & lenses
 
Graphics Lecture 7
Graphics Lecture 7Graphics Lecture 7
Graphics Lecture 7
 
10illumination
10illumination10illumination
10illumination
 
Ch 1 light and sight
Ch 1 light and sightCh 1 light and sight
Ch 1 light and sight
 
Optic, lens and iol
Optic, lens and iolOptic, lens and iol
Optic, lens and iol
 
Mirrors and lenses
Mirrors and lensesMirrors and lenses
Mirrors and lenses
 
optics mirrors_and_lenses (1)
optics mirrors_and_lenses (1)optics mirrors_and_lenses (1)
optics mirrors_and_lenses (1)
 
Reflection
ReflectionReflection
Reflection
 
Details About microscope (power Point)
Details About  microscope (power Point)Details About  microscope (power Point)
Details About microscope (power Point)
 
The microscope and its historical development
The microscope and its historical developmentThe microscope and its historical development
The microscope and its historical development
 
Optics basics concepts
Optics basics conceptsOptics basics concepts
Optics basics concepts
 
Notes on Optics
Notes on OpticsNotes on Optics
Notes on Optics
 
Microscope parts and functions
Microscope parts and functionsMicroscope parts and functions
Microscope parts and functions
 
Chapter 1 Microscopy
Chapter 1 MicroscopyChapter 1 Microscopy
Chapter 1 Microscopy
 
Geometrical Optics Introduction
Geometrical Optics IntroductionGeometrical Optics Introduction
Geometrical Optics Introduction
 
Condensers microscope/cosmetic dentistry courses
Condensers microscope/cosmetic dentistry coursesCondensers microscope/cosmetic dentistry courses
Condensers microscope/cosmetic dentistry courses
 
The nature and propagation of light
The nature and propagation of lightThe nature and propagation of light
The nature and propagation of light
 

Similar to Shading

Concept of basic illumination model
Concept of basic illumination modelConcept of basic illumination model
Concept of basic illumination modelAnkit Garg
 
illuminationmodelsshading-200501081735 (1).pdf
illuminationmodelsshading-200501081735 (1).pdfilluminationmodelsshading-200501081735 (1).pdf
illuminationmodelsshading-200501081735 (1).pdfSayantanMajhi2
 
UNIT-6-Illumination-Models-and-Surface-Rendering-Methods.pdf
UNIT-6-Illumination-Models-and-Surface-Rendering-Methods.pdfUNIT-6-Illumination-Models-and-Surface-Rendering-Methods.pdf
UNIT-6-Illumination-Models-and-Surface-Rendering-Methods.pdfSayantanMajhi2
 
Illumination model
Illumination modelIllumination model
Illumination modelAnkur Kumar
 
Lecture 1. Lighting Design.pptx
Lecture 1. Lighting Design.pptxLecture 1. Lighting Design.pptx
Lecture 1. Lighting Design.pptxNisthaPathak2
 
Ch 1 light and sight
Ch 1 light and sightCh 1 light and sight
Ch 1 light and sightFirman Otto
 
G10 Science Q2-Week 8- Properties of Mirror.ppt
G10 Science Q2-Week 8- Properties of Mirror.pptG10 Science Q2-Week 8- Properties of Mirror.ppt
G10 Science Q2-Week 8- Properties of Mirror.pptRegieBenigno
 
Light detailed work v1
Light detailed work v1Light detailed work v1
Light detailed work v1juliamor
 
lose of illumination
lose of illuminationlose of illumination
lose of illumination2461998
 
light-class7-220112081726.pdf
light-class7-220112081726.pdflight-class7-220112081726.pdf
light-class7-220112081726.pdfANKITAJHA84
 

Similar to Shading (20)

Concept of basic illumination model
Concept of basic illumination modelConcept of basic illumination model
Concept of basic illumination model
 
illuminationmodelsshading-200501081735 (1).pdf
illuminationmodelsshading-200501081735 (1).pdfilluminationmodelsshading-200501081735 (1).pdf
illuminationmodelsshading-200501081735 (1).pdf
 
Illumination Models & Shading
Illumination Models & ShadingIllumination Models & Shading
Illumination Models & Shading
 
Shading
ShadingShading
Shading
 
UNIT-6-Illumination-Models-and-Surface-Rendering-Methods.pdf
UNIT-6-Illumination-Models-and-Surface-Rendering-Methods.pdfUNIT-6-Illumination-Models-and-Surface-Rendering-Methods.pdf
UNIT-6-Illumination-Models-and-Surface-Rendering-Methods.pdf
 
Illumination model
Illumination modelIllumination model
Illumination model
 
Lecture 1. Lighting Design.pptx
Lecture 1. Lighting Design.pptxLecture 1. Lighting Design.pptx
Lecture 1. Lighting Design.pptx
 
october23.ppt
october23.pptoctober23.ppt
october23.ppt
 
Ch 1 light and sight
Ch 1 light and sightCh 1 light and sight
Ch 1 light and sight
 
Object rendering
Object renderingObject rendering
Object rendering
 
3 D texturing
 3 D texturing 3 D texturing
3 D texturing
 
G10 Science Q2-Week 8- Properties of Mirror.ppt
G10 Science Q2-Week 8- Properties of Mirror.pptG10 Science Q2-Week 8- Properties of Mirror.ppt
G10 Science Q2-Week 8- Properties of Mirror.ppt
 
Light detailed work v1
Light detailed work v1Light detailed work v1
Light detailed work v1
 
lose of illumination
lose of illuminationlose of illumination
lose of illumination
 
november6.ppt
november6.pptnovember6.ppt
november6.ppt
 
Reflection
ReflectionReflection
Reflection
 
Light class 7
Light   class 7Light   class 7
Light class 7
 
light-class7-220112081726.pdf
light-class7-220112081726.pdflight-class7-220112081726.pdf
light-class7-220112081726.pdf
 
Concave-and-convex.pptx
Concave-and-convex.pptxConcave-and-convex.pptx
Concave-and-convex.pptx
 
Opticsandlight
OpticsandlightOpticsandlight
Opticsandlight
 

More from Syed Zaid Irshad

More from Syed Zaid Irshad (20)

Operating System.pdf
Operating System.pdfOperating System.pdf
Operating System.pdf
 
DBMS_Lab_Manual_&_Solution
DBMS_Lab_Manual_&_SolutionDBMS_Lab_Manual_&_Solution
DBMS_Lab_Manual_&_Solution
 
Data Structure and Algorithms.pptx
Data Structure and Algorithms.pptxData Structure and Algorithms.pptx
Data Structure and Algorithms.pptx
 
Design and Analysis of Algorithms.pptx
Design and Analysis of Algorithms.pptxDesign and Analysis of Algorithms.pptx
Design and Analysis of Algorithms.pptx
 
Professional Issues in Computing
Professional Issues in ComputingProfessional Issues in Computing
Professional Issues in Computing
 
Reduce course notes class xi
Reduce course notes class xiReduce course notes class xi
Reduce course notes class xi
 
Reduce course notes class xii
Reduce course notes class xiiReduce course notes class xii
Reduce course notes class xii
 
Introduction to Database
Introduction to DatabaseIntroduction to Database
Introduction to Database
 
C Language
C LanguageC Language
C Language
 
Flowchart
FlowchartFlowchart
Flowchart
 
Algorithm Pseudo
Algorithm PseudoAlgorithm Pseudo
Algorithm Pseudo
 
Computer Programming
Computer ProgrammingComputer Programming
Computer Programming
 
ICS 2nd Year Book Introduction
ICS 2nd Year Book IntroductionICS 2nd Year Book Introduction
ICS 2nd Year Book Introduction
 
Security, Copyright and the Law
Security, Copyright and the LawSecurity, Copyright and the Law
Security, Copyright and the Law
 
Computer Architecture
Computer ArchitectureComputer Architecture
Computer Architecture
 
Data Communication
Data CommunicationData Communication
Data Communication
 
Information Networks
Information NetworksInformation Networks
Information Networks
 
Basic Concept of Information Technology
Basic Concept of Information TechnologyBasic Concept of Information Technology
Basic Concept of Information Technology
 
Introduction to ICS 1st Year Book
Introduction to ICS 1st Year BookIntroduction to ICS 1st Year Book
Introduction to ICS 1st Year Book
 
Using the set operators
Using the set operatorsUsing the set operators
Using the set operators
 

Recently uploaded

Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 

Recently uploaded (20)

Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 

Shading

  • 2. Objectives • Learn to shade objects so their images appear three-dimensional • Introduce the types of light-material interactions • Build a simple reflection model---the Phong model--- that can be used with real time graphics hardware 2
  • 3. Why we need shading • Suppose we build a model of a sphere using many polygons and color it with glColor. We get something like • But we want 3
  • 4. Shading •Why does the image of a real sphere look like •Light-material interactions cause each point to have a different color or shade •Need to consider • Light sources • Material properties • Location of viewer • Surface orientation 4
  • 5. Scattering • Light strikes A • Some scattered • Some absorbed • Some of scattered light strikes B • Some scattered • Some absorbed • Some of this scattered light strikes A and so on 5
  • 6. Rendering Equation • The infinite scattering and absorption of light can be described by the rendering equation • Cannot be solved in general • Ray tracing is a special case for perfectly reflecting surfaces • Rendering equation is global and includes • Shadows • Multiple scattering from object to object 6
  • 8. Local vs Global Rendering • Correct shading requires a global calculation involving all objects and light sources • Incompatible with pipeline model which shades each polygon independently (local rendering) • However, in computer graphics, especially real time graphics, we are happy if things “look right” • Exist many techniques for approximating global effects 8
  • 9. Light-Material Interaction •Light that strikes an object is partially absorbed and partially scattered (reflected) •The amount reflected determines the color and brightness of the object • A surface appears red under white light because the red component of the light is reflected and the rest is absorbed •The reflected light is scattered in a manner that depends on the smoothness and orientation of the surface 9
  • 10. Light Sources General light sources are difficult to work with because we must integrate light coming from all points on the source 10
  • 11. Simple Light Sources • Point source • Model with position and color • Distant source = infinite distance away (parallel) • Spotlight • Restrict light from ideal point source • Ambient light • Same amount of light everywhere in scene • Can model contribution of many sources and reflecting surfaces 11
  • 12. Surface Types •The smoother a surface, the more reflected light is concentrated in the direction a perfect mirror would reflected the light •A very rough surface scatters light in all directions 12 smooth surface rough surface
  • 13. Phong Model •A simple model that can be computed rapidly •Has three components • Diffuse • Specular • Ambient •Uses four vectors • To source • To viewer • Normal • Perfect reflector 13
  • 14. Ideal Reflector • Normal is determined by local orientation • Angle of incidence = angle of relection • The three vectors must be coplanar 14 r = 2 (l · n ) n - l
  • 15. Lambertian Surface • Perfectly diffuse reflector • Light scattered equally in all directions • Amount of light reflected is proportional to the vertical component of incoming light • reflected light ~cos θi • cos θi = l · n if vectors normalized • There are also three coefficients, kr, kb, kg that show how much of each color component is reflected 15
  • 16. Specular Surfaces •Most surfaces are neither ideal diffusers nor perfectly specular (ideal reflectors) •Smooth surfaces show specular highlights due to incoming light being reflected in directions concentrated close to the direction of a perfect reflection 16 specular highlight
  • 17. Modeling Specular Relections • Phong proposed using a term that dropped off as the angle between the viewer and the ideal reflection increased 17 φ Ir ~ ks I cosα φ shininess coef absorption coef incoming intensity reflected intensity
  • 18. The Shininess Coefficient •Values of α between 100 and 200 correspond to metals •Values between 5 and 10 give surface that look like plastic 18 cosα φ φ 90-90