SlideShare a Scribd company logo
1 of 16
Shading II
1
Objectives
• Continue discussion of shading
• Introduce modified Phong model
• Consider computation of required vectors
2
Ambient Light
• Ambient light is the result of multiple interactions between (large)
light sources and the objects in the environment
• Amount and color depend on both the color of the light(s) and the
material properties of the object
• Add ka Ia to diffuse and specular terms
3
reflection coef intensity of ambient light
Distance Terms
• The light from a point source that reaches a surface is inversely
proportional to the square of the distance between them
• We can add a factor of the
form 1/(ad + bd +cd2
) to
the diffuse and specular
terms
• The constant and linear terms soften the effect of the point source
4
Light Sources
• In the Phong Model, we add the results from each light source
• Each light source has separate diffuse, specular, and ambient terms
to allow for maximum flexibility even though this form does not have
a physical justification
• Separate red, green and blue components
• Hence, 9 coefficients for each point source
• Idr, Idg, Idb, Isr, Isg, Isb, Iar, Iag, Iab
5
Material Properties
• Material properties match light source properties
• Nine absorbtion coefficients
• kdr, kdg, kdb, ksr, ksg, ksb, kar, kag, kab
• Shininess coefficient α
6
Adding up the Components
For each light source and each color
component, the Phong model can be written
(without the distance terms) as
I =kd Id l · n + ks Is (v · r )α
+ ka Ia
For each color component
we add contributions from
all sources
7
Modified Phong Model
• The specular term in the Phong model is problematic because it
requires the calculation of a new reflection vector and view vector
for each vertex
• Blinn suggested an approximation using the halfway vector that is
more efficient
8
The Halfway Vector
• h is normalized vector halfway between l and v
9
h = ( l + v )/ | l + v |
Using the halfway vector
• Replace (v · r )α
by (n · h )β
•β is chosen to match shineness
• Note that halway angle is half of angle between r and v if vectors are
coplanar
• Resulting model is known as the modified Phong or Blinn lighting
model
•Specified in OpenGL standard
10
Example
11
Only differences in
these teapots are
the parameters
in the modified
Phong model
Computation of Vectors
• l and v are specified by the application
•Can computer r from l and n
•Problem is determining n
•For simple surfaces is can be determined but how
we determine n differs depending on underlying
representation of surface
•OpenGL leaves determination of normal to
application
• Exception for GLU quadrics and Bezier surfaces (Chapter 11)
12
Plane Normals
• Equation of plane: ax+by+cz+d = 0
• From Chapter 4 we know that plane is determined by three points p0,
p2, p3 or normal n and p0
• Normal can be obtained by
13
n = (p2-p0) × (p1-p0)
Normal to Sphere
• Implicit function f(x,y.z)=0
• Normal given by gradient
• Sphere f(p)=p·p-1
• n = [∂f/∂x, ∂f/∂y, ∂f/∂z]T
=p
14
Parametric Form
• For sphere
• Tangent plane determined by vectors
• Normal given by cross product
15
x=x(u,v)=cos u sin v
y=y(u,v)=cos u cos v
z= z(u,v)=sin u
∂p/∂u = [∂x/∂u, ∂y/∂u, ∂z/∂u]T
∂p/∂v = [∂x/∂v, ∂y/∂v, ∂z/∂v]T
n = ∂p/∂u × ∂p/∂v
General Case
• We can compute parametric normals for other simple cases
• Quadrics
• Parameteric polynomial surfaces
• Bezier surface patches (Chapter 11)
16

More Related Content

What's hot

Accurate Learning of Graph Representations with Graph Multiset Pooling
Accurate Learning of Graph Representations with Graph Multiset PoolingAccurate Learning of Graph Representations with Graph Multiset Pooling
Accurate Learning of Graph Representations with Graph Multiset PoolingMLAI2
 
Integrating spheres
Integrating spheresIntegrating spheres
Integrating spheresJehona Salaj
 
OpenCV presentation series- part 4
OpenCV presentation series- part 4OpenCV presentation series- part 4
OpenCV presentation series- part 4Sairam Adithya
 
Presentation for Numerical Field Theory
Presentation for Numerical Field TheoryPresentation for Numerical Field Theory
Presentation for Numerical Field TheoryIndraneel Pole
 
OpenCV presentation series- part 5
OpenCV presentation series- part 5OpenCV presentation series- part 5
OpenCV presentation series- part 5Sairam Adithya
 
1.arithmetic & logical operations
1.arithmetic & logical operations1.arithmetic & logical operations
1.arithmetic & logical operationsmukesh bhardwaj
 
A summary of Categorical Reparameterization with Gumbel-Softmax by Jang et al...
A summary of Categorical Reparameterization with Gumbel-Softmax by Jang et al...A summary of Categorical Reparameterization with Gumbel-Softmax by Jang et al...
A summary of Categorical Reparameterization with Gumbel-Softmax by Jang et al...Jin-Hwa Kim
 
Machine learning for high-speed corner detection
Machine learning for high-speed corner detectionMachine learning for high-speed corner detection
Machine learning for high-speed corner detectionbutest
 
Demosaicing of images for bayer cfa using projection algorithm
Demosaicing of images for bayer cfa using projection algorithmDemosaicing of images for bayer cfa using projection algorithm
Demosaicing of images for bayer cfa using projection algorithmeSAT Publishing House
 
On Line Training of the Path-Loss Model in Bayesian WLAN Indoor Positioning
On Line Training of the Path-Loss Model in Bayesian WLAN Indoor PositioningOn Line Training of the Path-Loss Model in Bayesian WLAN Indoor Positioning
On Line Training of the Path-Loss Model in Bayesian WLAN Indoor Positioninglbruno236
 
Example of iterative deepening search & bidirectional search
Example of iterative deepening search & bidirectional searchExample of iterative deepening search & bidirectional search
Example of iterative deepening search & bidirectional searchAbhijeet Agarwal
 
Mathematical operations in image processing
Mathematical operations in image processingMathematical operations in image processing
Mathematical operations in image processingAsad Ali
 
APPLYING R-SPATIOGRAM IN OBJECT TRACKING FOR OCCLUSION HANDLING
APPLYING R-SPATIOGRAM IN OBJECT TRACKING FOR OCCLUSION HANDLINGAPPLYING R-SPATIOGRAM IN OBJECT TRACKING FOR OCCLUSION HANDLING
APPLYING R-SPATIOGRAM IN OBJECT TRACKING FOR OCCLUSION HANDLINGsipij
 
Strength of widefield microscope
Strength of widefield microscopeStrength of widefield microscope
Strength of widefield microscopeShagufta Naz
 
Neural Inverse Rendering for General Reflectance Photometric Stereo (ICML 2018)
Neural Inverse Rendering for General Reflectance Photometric Stereo (ICML 2018)Neural Inverse Rendering for General Reflectance Photometric Stereo (ICML 2018)
Neural Inverse Rendering for General Reflectance Photometric Stereo (ICML 2018)Tatsunori Taniai
 
Five Minute Speech: Activities Developed in Computational Geometry Discipline
Five Minute Speech: Activities Developed in Computational Geometry DisciplineFive Minute Speech: Activities Developed in Computational Geometry Discipline
Five Minute Speech: Activities Developed in Computational Geometry DisciplineMichel Alves
 

What's hot (20)

Accurate Learning of Graph Representations with Graph Multiset Pooling
Accurate Learning of Graph Representations with Graph Multiset PoolingAccurate Learning of Graph Representations with Graph Multiset Pooling
Accurate Learning of Graph Representations with Graph Multiset Pooling
 
Resampling- GIS
Resampling- GISResampling- GIS
Resampling- GIS
 
Integrating spheres
Integrating spheresIntegrating spheres
Integrating spheres
 
KNN
KNNKNN
KNN
 
OpenCV presentation series- part 4
OpenCV presentation series- part 4OpenCV presentation series- part 4
OpenCV presentation series- part 4
 
Presentation for Numerical Field Theory
Presentation for Numerical Field TheoryPresentation for Numerical Field Theory
Presentation for Numerical Field Theory
 
OpenCV presentation series- part 5
OpenCV presentation series- part 5OpenCV presentation series- part 5
OpenCV presentation series- part 5
 
Orb feature by nitin
Orb feature by nitinOrb feature by nitin
Orb feature by nitin
 
1.arithmetic & logical operations
1.arithmetic & logical operations1.arithmetic & logical operations
1.arithmetic & logical operations
 
A summary of Categorical Reparameterization with Gumbel-Softmax by Jang et al...
A summary of Categorical Reparameterization with Gumbel-Softmax by Jang et al...A summary of Categorical Reparameterization with Gumbel-Softmax by Jang et al...
A summary of Categorical Reparameterization with Gumbel-Softmax by Jang et al...
 
Machine learning for high-speed corner detection
Machine learning for high-speed corner detectionMachine learning for high-speed corner detection
Machine learning for high-speed corner detection
 
Color models
Color modelsColor models
Color models
 
Demosaicing of images for bayer cfa using projection algorithm
Demosaicing of images for bayer cfa using projection algorithmDemosaicing of images for bayer cfa using projection algorithm
Demosaicing of images for bayer cfa using projection algorithm
 
On Line Training of the Path-Loss Model in Bayesian WLAN Indoor Positioning
On Line Training of the Path-Loss Model in Bayesian WLAN Indoor PositioningOn Line Training of the Path-Loss Model in Bayesian WLAN Indoor Positioning
On Line Training of the Path-Loss Model in Bayesian WLAN Indoor Positioning
 
Example of iterative deepening search & bidirectional search
Example of iterative deepening search & bidirectional searchExample of iterative deepening search & bidirectional search
Example of iterative deepening search & bidirectional search
 
Mathematical operations in image processing
Mathematical operations in image processingMathematical operations in image processing
Mathematical operations in image processing
 
APPLYING R-SPATIOGRAM IN OBJECT TRACKING FOR OCCLUSION HANDLING
APPLYING R-SPATIOGRAM IN OBJECT TRACKING FOR OCCLUSION HANDLINGAPPLYING R-SPATIOGRAM IN OBJECT TRACKING FOR OCCLUSION HANDLING
APPLYING R-SPATIOGRAM IN OBJECT TRACKING FOR OCCLUSION HANDLING
 
Strength of widefield microscope
Strength of widefield microscopeStrength of widefield microscope
Strength of widefield microscope
 
Neural Inverse Rendering for General Reflectance Photometric Stereo (ICML 2018)
Neural Inverse Rendering for General Reflectance Photometric Stereo (ICML 2018)Neural Inverse Rendering for General Reflectance Photometric Stereo (ICML 2018)
Neural Inverse Rendering for General Reflectance Photometric Stereo (ICML 2018)
 
Five Minute Speech: Activities Developed in Computational Geometry Discipline
Five Minute Speech: Activities Developed in Computational Geometry DisciplineFive Minute Speech: Activities Developed in Computational Geometry Discipline
Five Minute Speech: Activities Developed in Computational Geometry Discipline
 

Similar to Shading

Illumination model
Illumination modelIllumination model
Illumination modelAnkur Kumar
 
illumination model in Computer Graphics by irru pychukar
illumination model in Computer Graphics by irru pychukarillumination model in Computer Graphics by irru pychukar
illumination model in Computer Graphics by irru pychukarsyedArr
 
illuminationmodelsshading-200501081735 (1).pdf
illuminationmodelsshading-200501081735 (1).pdfilluminationmodelsshading-200501081735 (1).pdf
illuminationmodelsshading-200501081735 (1).pdfSayantanMajhi2
 
Exponential contrast restoration in fog
Exponential contrast restoration in fogExponential contrast restoration in fog
Exponential contrast restoration in fogSREEKUTTY SREEKUMAR
 
OFC PPT Optical Sources Unit 5-4-23.pptx
OFC PPT Optical Sources Unit 5-4-23.pptxOFC PPT Optical Sources Unit 5-4-23.pptx
OFC PPT Optical Sources Unit 5-4-23.pptx2BA19EC113Vijay
 
optical sources keiser.ppt
optical sources keiser.pptoptical sources keiser.ppt
optical sources keiser.pptsrividyaL1
 
Phong Shading over any Polygonal Surface
Phong Shading over any Polygonal Surface Phong Shading over any Polygonal Surface
Phong Shading over any Polygonal Surface Bhuvnesh Pratap
 
Analysis of SAED patterns
Analysis of SAED patternsAnalysis of SAED patterns
Analysis of SAED patternsAntilen Jacob
 
Presentation on semi conductors LEDs more
Presentation on semi conductors LEDs morePresentation on semi conductors LEDs more
Presentation on semi conductors LEDs moreTakashiSuoh
 
37-.ocn_.ppt Optimizing slideshow... photodiiode
37-.ocn_.ppt Optimizing slideshow... photodiiode37-.ocn_.ppt Optimizing slideshow... photodiiode
37-.ocn_.ppt Optimizing slideshow... photodiiodeNandanas11
 
One day short course on Green Building Assessment Methods - Daylight Simulation
One day short course on Green Building Assessment Methods - Daylight SimulationOne day short course on Green Building Assessment Methods - Daylight Simulation
One day short course on Green Building Assessment Methods - Daylight Simulationekwtsang
 
03 cie552 image_filtering_spatial
03 cie552 image_filtering_spatial03 cie552 image_filtering_spatial
03 cie552 image_filtering_spatialElsayed Hemayed
 

Similar to Shading (20)

graphics notes
graphics notesgraphics notes
graphics notes
 
Illumination model
Illumination modelIllumination model
Illumination model
 
illumination model in Computer Graphics by irru pychukar
illumination model in Computer Graphics by irru pychukarillumination model in Computer Graphics by irru pychukar
illumination model in Computer Graphics by irru pychukar
 
Illumination Models & Shading
Illumination Models & ShadingIllumination Models & Shading
Illumination Models & Shading
 
illuminationmodelsshading-200501081735 (1).pdf
illuminationmodelsshading-200501081735 (1).pdfilluminationmodelsshading-200501081735 (1).pdf
illuminationmodelsshading-200501081735 (1).pdf
 
Lighting and shading
Lighting and shadingLighting and shading
Lighting and shading
 
Exponential contrast restoration in fog
Exponential contrast restoration in fogExponential contrast restoration in fog
Exponential contrast restoration in fog
 
Unit iii
Unit iiiUnit iii
Unit iii
 
OFC PPT Optical Sources Unit 5-4-23.pptx
OFC PPT Optical Sources Unit 5-4-23.pptxOFC PPT Optical Sources Unit 5-4-23.pptx
OFC PPT Optical Sources Unit 5-4-23.pptx
 
optical sources keiser.ppt
optical sources keiser.pptoptical sources keiser.ppt
optical sources keiser.ppt
 
CS 354 Lighting
CS 354 LightingCS 354 Lighting
CS 354 Lighting
 
Phong Shading over any Polygonal Surface
Phong Shading over any Polygonal Surface Phong Shading over any Polygonal Surface
Phong Shading over any Polygonal Surface
 
Analysis of SAED patterns
Analysis of SAED patternsAnalysis of SAED patterns
Analysis of SAED patterns
 
Shading
ShadingShading
Shading
 
Shading in OpenGL
Shading in OpenGLShading in OpenGL
Shading in OpenGL
 
Reflector antennas
Reflector antennasReflector antennas
Reflector antennas
 
Presentation on semi conductors LEDs more
Presentation on semi conductors LEDs morePresentation on semi conductors LEDs more
Presentation on semi conductors LEDs more
 
37-.ocn_.ppt Optimizing slideshow... photodiiode
37-.ocn_.ppt Optimizing slideshow... photodiiode37-.ocn_.ppt Optimizing slideshow... photodiiode
37-.ocn_.ppt Optimizing slideshow... photodiiode
 
One day short course on Green Building Assessment Methods - Daylight Simulation
One day short course on Green Building Assessment Methods - Daylight SimulationOne day short course on Green Building Assessment Methods - Daylight Simulation
One day short course on Green Building Assessment Methods - Daylight Simulation
 
03 cie552 image_filtering_spatial
03 cie552 image_filtering_spatial03 cie552 image_filtering_spatial
03 cie552 image_filtering_spatial
 

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

chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringmulugeta48
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxfenichawla
 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Christo Ananth
 
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSUNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSrknatarajan
 
Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spaintimesproduction05
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdfSuman Jyoti
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 

Recently uploaded (20)

chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSUNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
 
Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spain
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 

Shading

  • 2. Objectives • Continue discussion of shading • Introduce modified Phong model • Consider computation of required vectors 2
  • 3. Ambient Light • Ambient light is the result of multiple interactions between (large) light sources and the objects in the environment • Amount and color depend on both the color of the light(s) and the material properties of the object • Add ka Ia to diffuse and specular terms 3 reflection coef intensity of ambient light
  • 4. Distance Terms • The light from a point source that reaches a surface is inversely proportional to the square of the distance between them • We can add a factor of the form 1/(ad + bd +cd2 ) to the diffuse and specular terms • The constant and linear terms soften the effect of the point source 4
  • 5. Light Sources • In the Phong Model, we add the results from each light source • Each light source has separate diffuse, specular, and ambient terms to allow for maximum flexibility even though this form does not have a physical justification • Separate red, green and blue components • Hence, 9 coefficients for each point source • Idr, Idg, Idb, Isr, Isg, Isb, Iar, Iag, Iab 5
  • 6. Material Properties • Material properties match light source properties • Nine absorbtion coefficients • kdr, kdg, kdb, ksr, ksg, ksb, kar, kag, kab • Shininess coefficient α 6
  • 7. Adding up the Components For each light source and each color component, the Phong model can be written (without the distance terms) as I =kd Id l · n + ks Is (v · r )α + ka Ia For each color component we add contributions from all sources 7
  • 8. Modified Phong Model • The specular term in the Phong model is problematic because it requires the calculation of a new reflection vector and view vector for each vertex • Blinn suggested an approximation using the halfway vector that is more efficient 8
  • 9. The Halfway Vector • h is normalized vector halfway between l and v 9 h = ( l + v )/ | l + v |
  • 10. Using the halfway vector • Replace (v · r )α by (n · h )β •β is chosen to match shineness • Note that halway angle is half of angle between r and v if vectors are coplanar • Resulting model is known as the modified Phong or Blinn lighting model •Specified in OpenGL standard 10
  • 11. Example 11 Only differences in these teapots are the parameters in the modified Phong model
  • 12. Computation of Vectors • l and v are specified by the application •Can computer r from l and n •Problem is determining n •For simple surfaces is can be determined but how we determine n differs depending on underlying representation of surface •OpenGL leaves determination of normal to application • Exception for GLU quadrics and Bezier surfaces (Chapter 11) 12
  • 13. Plane Normals • Equation of plane: ax+by+cz+d = 0 • From Chapter 4 we know that plane is determined by three points p0, p2, p3 or normal n and p0 • Normal can be obtained by 13 n = (p2-p0) × (p1-p0)
  • 14. Normal to Sphere • Implicit function f(x,y.z)=0 • Normal given by gradient • Sphere f(p)=p·p-1 • n = [∂f/∂x, ∂f/∂y, ∂f/∂z]T =p 14
  • 15. Parametric Form • For sphere • Tangent plane determined by vectors • Normal given by cross product 15 x=x(u,v)=cos u sin v y=y(u,v)=cos u cos v z= z(u,v)=sin u ∂p/∂u = [∂x/∂u, ∂y/∂u, ∂z/∂u]T ∂p/∂v = [∂x/∂v, ∂y/∂v, ∂z/∂v]T n = ∂p/∂u × ∂p/∂v
  • 16. General Case • We can compute parametric normals for other simple cases • Quadrics • Parameteric polynomial surfaces • Bezier surface patches (Chapter 11) 16