The Wayback Machine - https://web.archive.org/web/20240215045222/https://www.geeksforgeeks.org/phong-shading-computer-graphics/
Open In App
Related Articles

Phong Shading Computer Graphics

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report

Phong shading is a more accurate interpolation-based approach that can be used for rendering a polygon. It was developed by Phong Bui Tuong.It improves upon the Gourand Shading and provides a better approximation of the shading of any smooth surface. It interpolates the normal vector instead of the intensity values.

Surface rendering is done with the help of Phong shading in the following manner:

  • Determine the average unit normal vector at each polygon vertex.

              So, for n polygons => summation of Ni/ | summation of Ni | (where i is initialized from 1 to N)

  • Linearly interpolate the vertex normal over the surfaces of the polygon.   N= (y-y2)/(y1-y2) N1 + (y1-y)/(y1-y2) N2

Interpolation of the surface normal

                                                      

  • By applying the illumination model along each scan we have to determine the projected pixel intensities of the surface points.

Advantages:

  1. Some dark and bright intensity streaks known as mach bands appear on the surface due to the linear intensity interpolation, this method reduces the mach band effects and displays more realistic highlights.
  2. It is more accurate as compared to the Gourand Shading.

Disadvantages:

  1. It is slower as compared to the Gourand Shading.
  2. It requires more calculation, hence it increases the cost of shading at each successive step.

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!


Last Updated : 11 Apr, 2023
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads