SlideShare uma empresa Scribd logo
1 de 18
Shading “  Shading is referred as  the  implementation of illumination model   at the pixel points  or  polygon surfaces of the graphics objects .”
Constant-Intensity Shading ,[object Object],Fig(1). A polygon mesh approximation of an object (a) is rendered with flat shading (b) and With Gouraud shading  (c).
[object Object],[object Object],[object Object],[object Object]
Gouraud Shading ,[object Object],[object Object],[object Object],[object Object],[object Object]
At each polygon vertex, we obtain a normal vector by averaging the surface normals of all polygons starting  that vertex, as illustrated in Fig.(2).  Thus, for any vertex position V, we obtain the unit vertex normal with the calculation Once we have the vertex normals, we can determine the intensity at the vertices from a lighting model. Figure (2). The normal vector at vertex V is calculated as the average of the surface normals for each polygon  sharing that vertex. N 1 N 2 N 3 N 4 V
[object Object],3 Y X Scan Line 5 2 4 1 Fig(3). For Gouraud shading, the intensity at point 4 is linearly interpolated from the intensities at vertices 1 and2. The intensity at point 5 is linearly interpolated from intensities at vertices 2 and 3. An interior point p is then assigned an intensity value that is linearly interpolated from intensities at positions 4 and 5. P
[object Object],I 1 +  I 2 I 4 =  y 4 -y 2 y 1 -y 2 y 1 -y 4 y 1 -y 2 I 4 +  I 5 I P =  X 5 - X P X 5 - X 4 X P - X 4 X 5 - X 4
[object Object],3 Y X Scan Lines I 2 I 1 Y-1 I’ I X X+1 Fig.(4) Incremental interpolation  of intensity values along a polygon edge for successive scan lines.
+  I 2 I =  Y - Y 2 Y 1 - Y 2 Y 1 - Y Y 1 - Y 2 I 1 then we can obtain the intensity along this edge for the next scan line, y - I, as I’=I+ Y 1 - Y 2 I 2 - I 1 if the intensity at edge position (x,y) is interpolated as
Similar calculations are used to obtain intensities at successive horizontal pixel positions along each scan line.  When surfaces are to be rendered in color, the intensity of each color component is calculated at the vertices. Gouraud shading can be combined with a hidden-surface algorithm to fill in the visible polygons along each scan line. An example of an object shaded with the Gouraud method appears in following Fig. A polygon mesh approximation of an object (a) is rendered with flat shading (b) and With Gouraud shading  (c).
[object Object],[object Object]
Phong Shading ,[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],Scan Line N  N  1 N  3 N  2 Fig.(5)  Interpolation of surface normals Along a polygon edge. N 1 +  N 2 N=  Y - Y 2 Y 1 - Y 2 Y 1 - Y Y 1 - Y 2
[object Object],[object Object]
Fast Phong Shading ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],I diff (x,y)=  = =
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],I diff (x,y)=  a= I diff (x,y)=
[object Object],[object Object]

Mais conteúdo relacionado

Mais procurados

Polygon clipping
Polygon clippingPolygon clipping
Polygon clipping
Mohd Arif
 
Two dimensional viewing
Two dimensional viewingTwo dimensional viewing
Two dimensional viewing
Mohd Arif
 
Visible surface detection in computer graphic
Visible surface detection in computer graphicVisible surface detection in computer graphic
Visible surface detection in computer graphic
anku2266
 

Mais procurados (20)

Halftoning in Computer Graphics
Halftoning  in Computer GraphicsHalftoning  in Computer Graphics
Halftoning in Computer Graphics
 
Hidden surface removal
Hidden surface removalHidden surface removal
Hidden surface removal
 
Output primitives in Computer Graphics
Output primitives in Computer GraphicsOutput primitives in Computer Graphics
Output primitives in Computer Graphics
 
Raster scan system & random scan system
Raster scan system & random scan systemRaster scan system & random scan system
Raster scan system & random scan system
 
2D transformation (Computer Graphics)
2D transformation (Computer Graphics)2D transformation (Computer Graphics)
2D transformation (Computer Graphics)
 
3D transformation in computer graphics
3D transformation in computer graphics3D transformation in computer graphics
3D transformation in computer graphics
 
Polygon clipping
Polygon clippingPolygon clipping
Polygon clipping
 
Back face detection
Back face detectionBack face detection
Back face detection
 
4. THREE DIMENSIONAL DISPLAY METHODS
4.	THREE DIMENSIONAL DISPLAY METHODS4.	THREE DIMENSIONAL DISPLAY METHODS
4. THREE DIMENSIONAL DISPLAY METHODS
 
Projection In Computer Graphics
Projection In Computer GraphicsProjection In Computer Graphics
Projection In Computer Graphics
 
Polygon filling algorithm
Polygon filling algorithmPolygon filling algorithm
Polygon filling algorithm
 
Two dimensional viewing
Two dimensional viewingTwo dimensional viewing
Two dimensional viewing
 
Unit 3
Unit 3Unit 3
Unit 3
 
3 d display methods
3 d display methods3 d display methods
3 d display methods
 
Visible surface detection in computer graphic
Visible surface detection in computer graphicVisible surface detection in computer graphic
Visible surface detection in computer graphic
 
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
 
Quadric surfaces
Quadric surfacesQuadric surfaces
Quadric surfaces
 
Anti aliasing Computer Graphics
Anti aliasing Computer GraphicsAnti aliasing Computer Graphics
Anti aliasing Computer Graphics
 
Raster animation
Raster animationRaster animation
Raster animation
 
2D viewing & clipping
2D viewing & clipping2D viewing & clipping
2D viewing & clipping
 

Destaque

Geometric modeling111431635 geometric-modeling-glad (1)
Geometric modeling111431635 geometric-modeling-glad (1)Geometric modeling111431635 geometric-modeling-glad (1)
Geometric modeling111431635 geometric-modeling-glad (1)
manojg1990
 
Hidden surfaces
Hidden surfacesHidden surfaces
Hidden surfaces
Mohd Arif
 
ILLUMINATION & LIGHTING
ILLUMINATION & LIGHTINGILLUMINATION & LIGHTING
ILLUMINATION & LIGHTING
Hemant Suthar
 

Destaque (17)

Illumination model
Illumination modelIllumination model
Illumination model
 
Ray tracing
 Ray tracing Ray tracing
Ray tracing
 
3D Graphics & Rendering in Computer Graphics
3D Graphics & Rendering in Computer Graphics3D Graphics & Rendering in Computer Graphics
3D Graphics & Rendering in Computer Graphics
 
Phong Shading over any Polygonal Surface
Phong Shading over any Polygonal Surface Phong Shading over any Polygonal Surface
Phong Shading over any Polygonal Surface
 
Shading and two type of shading flat shading and gauraud shading with coding ...
Shading and two type of shading flat shading and gauraud shading with coding ...Shading and two type of shading flat shading and gauraud shading with coding ...
Shading and two type of shading flat shading and gauraud shading with coding ...
 
Illumination Model
Illumination ModelIllumination Model
Illumination Model
 
GRPHICS06 - Shading
GRPHICS06 - ShadingGRPHICS06 - Shading
GRPHICS06 - Shading
 
Geometric modelling
Geometric modellingGeometric modelling
Geometric modelling
 
191483523 geometric-modeling
191483523 geometric-modeling191483523 geometric-modeling
191483523 geometric-modeling
 
5 geometric-modeling-ppt-university-of-victoria
5 geometric-modeling-ppt-university-of-victoria5 geometric-modeling-ppt-university-of-victoria
5 geometric-modeling-ppt-university-of-victoria
 
Parametric modelling
Parametric modellingParametric modelling
Parametric modelling
 
Geometric Modeling
Geometric Modeling Geometric Modeling
Geometric Modeling
 
Geometric modeling111431635 geometric-modeling-glad (1)
Geometric modeling111431635 geometric-modeling-glad (1)Geometric modeling111431635 geometric-modeling-glad (1)
Geometric modeling111431635 geometric-modeling-glad (1)
 
Computer Graphics - Hidden Line Removal Algorithm
Computer Graphics - Hidden Line Removal AlgorithmComputer Graphics - Hidden Line Removal Algorithm
Computer Graphics - Hidden Line Removal Algorithm
 
Hidden surfaces
Hidden surfacesHidden surfaces
Hidden surfaces
 
ILLUMINATION & LIGHTING
ILLUMINATION & LIGHTINGILLUMINATION & LIGHTING
ILLUMINATION & LIGHTING
 
Color Models
Color ModelsColor Models
Color Models
 

Semelhante a Shading

Computer Vision: Shape from Specularities and Motion
Computer Vision: Shape from Specularities and MotionComputer Vision: Shape from Specularities and Motion
Computer Vision: Shape from Specularities and Motion
Damian T. Gordon
 
Visible surface determination
Visible  surface determinationVisible  surface determination
Visible surface determination
Patel Punit
 

Semelhante a Shading (20)

Shading methods
Shading methodsShading methods
Shading methods
 
Computer Vision: Shape from Specularities and Motion
Computer Vision: Shape from Specularities and MotionComputer Vision: Shape from Specularities and Motion
Computer Vision: Shape from Specularities and Motion
 
Study on Contrast Enhancement with the help of Associate Regions Histogram Eq...
Study on Contrast Enhancement with the help of Associate Regions Histogram Eq...Study on Contrast Enhancement with the help of Associate Regions Histogram Eq...
Study on Contrast Enhancement with the help of Associate Regions Histogram Eq...
 
FACE RECOGNITION ALGORITHM BASED ON ORIENTATION HISTOGRAM OF HOUGH PEAKS
FACE RECOGNITION ALGORITHM BASED ON ORIENTATION HISTOGRAM OF HOUGH PEAKSFACE RECOGNITION ALGORITHM BASED ON ORIENTATION HISTOGRAM OF HOUGH PEAKS
FACE RECOGNITION ALGORITHM BASED ON ORIENTATION HISTOGRAM OF HOUGH PEAKS
 
Visible surface determination
Visible  surface determinationVisible  surface determination
Visible surface determination
 
Rendering equation
Rendering equationRendering equation
Rendering equation
 
Image restoration and reconstruction
Image restoration and reconstructionImage restoration and reconstruction
Image restoration and reconstruction
 
Reflection, Scaling, Shear, Translation, and Rotation
Reflection, Scaling, Shear, Translation, and RotationReflection, Scaling, Shear, Translation, and Rotation
Reflection, Scaling, Shear, Translation, and Rotation
 
lec41.ppt
lec41.pptlec41.ppt
lec41.ppt
 
3rd unit.pptx
3rd unit.pptx3rd unit.pptx
3rd unit.pptx
 
graphics notes
graphics notesgraphics notes
graphics notes
 
Lec_3_Image Enhancement_spatial Domain.pdf
Lec_3_Image Enhancement_spatial Domain.pdfLec_3_Image Enhancement_spatial Domain.pdf
Lec_3_Image Enhancement_spatial Domain.pdf
 
matdid950092.pdf
matdid950092.pdfmatdid950092.pdf
matdid950092.pdf
 
Digital image processing
Digital image processingDigital image processing
Digital image processing
 
3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides
 
Advanced Approach for Slopes Measurement by Non - Contact Optical Technique
Advanced Approach for Slopes Measurement by Non - Contact Optical TechniqueAdvanced Approach for Slopes Measurement by Non - Contact Optical Technique
Advanced Approach for Slopes Measurement by Non - Contact Optical Technique
 
Multimedia color in image and video
Multimedia color in image and videoMultimedia color in image and video
Multimedia color in image and video
 
Hidden Surface Removal using Z-buffer
Hidden Surface Removal using Z-bufferHidden Surface Removal using Z-buffer
Hidden Surface Removal using Z-buffer
 
Hcr's Theory of Polygon (Proposed by Mr Harish Chandra Rajpoot)
Hcr's Theory of Polygon (Proposed by Mr Harish Chandra Rajpoot)Hcr's Theory of Polygon (Proposed by Mr Harish Chandra Rajpoot)
Hcr's Theory of Polygon (Proposed by Mr Harish Chandra Rajpoot)
 
Hidden lines & surfaces
Hidden lines & surfacesHidden lines & surfaces
Hidden lines & surfaces
 

Mais de Amit Kapoor

Mais de Amit Kapoor (17)

Tweening and morphing
Tweening and morphingTweening and morphing
Tweening and morphing
 
Study from where
Study from whereStudy from where
Study from where
 
Projection
ProjectionProjection
Projection
 
Display devices
Display devicesDisplay devices
Display devices
 
Computer graphics syllabus
Computer graphics syllabusComputer graphics syllabus
Computer graphics syllabus
 
Cg my own programs
Cg my own programsCg my own programs
Cg my own programs
 
Animation
AnimationAnimation
Animation
 
3 d modeling of objects
3 d modeling of objects3 d modeling of objects
3 d modeling of objects
 
Essential c
Essential cEssential c
Essential c
 
C aptitude scribd
C aptitude scribdC aptitude scribd
C aptitude scribd
 
C in7-days
C in7-daysC in7-days
C in7-days
 
C interview question answer 2
C interview question answer 2C interview question answer 2
C interview question answer 2
 
C interview question answer 1
C interview question answer 1C interview question answer 1
C interview question answer 1
 
C notes mca i sem 2011
C notes mca i sem 2011C notes mca i sem 2011
C notes mca i sem 2011
 
C tutorials
C tutorialsC tutorials
C tutorials
 
User defined data type
User defined data typeUser defined data type
User defined data type
 
2 d transformations by amit kumar (maimt)
2 d transformations by amit kumar (maimt)2 d transformations by amit kumar (maimt)
2 d transformations by amit kumar (maimt)
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 

Shading

  • 1. Shading “ Shading is referred as the implementation of illumination model at the pixel points or polygon surfaces of the graphics objects .”
  • 2.
  • 3.
  • 4.
  • 5. At each polygon vertex, we obtain a normal vector by averaging the surface normals of all polygons starting that vertex, as illustrated in Fig.(2). Thus, for any vertex position V, we obtain the unit vertex normal with the calculation Once we have the vertex normals, we can determine the intensity at the vertices from a lighting model. Figure (2). The normal vector at vertex V is calculated as the average of the surface normals for each polygon sharing that vertex. N 1 N 2 N 3 N 4 V
  • 6.
  • 7.
  • 8.
  • 9. + I 2 I = Y - Y 2 Y 1 - Y 2 Y 1 - Y Y 1 - Y 2 I 1 then we can obtain the intensity along this edge for the next scan line, y - I, as I’=I+ Y 1 - Y 2 I 2 - I 1 if the intensity at edge position (x,y) is interpolated as
  • 10. Similar calculations are used to obtain intensities at successive horizontal pixel positions along each scan line. When surfaces are to be rendered in color, the intensity of each color component is calculated at the vertices. Gouraud shading can be combined with a hidden-surface algorithm to fill in the visible polygons along each scan line. An example of an object shaded with the Gouraud method appears in following Fig. A polygon mesh approximation of an object (a) is rendered with flat shading (b) and With Gouraud shading (c).
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.