Phong shading

From Wikipedia, the free encyclopedia

An application of the Phong reflection model.

Phong shading is an interpolation method in 3D computer graphics, using interpolation of surface normals in rasterizing polygons, to get better resolution of specular reflections such as those generated by the Phong reflection model.

Since the inventor's publications combined the interpolation technique with his reflection model, the term Phong shading is also commonly used to refer to the reflection model or to the combination of the reflection model and the interpolation method.

These methods were developed by Bui Tuong Phong, who published them in his 1973 Ph.D. dissertation at the University of Utah.

Phong reflection is a local illumination model that can produce a certain degree of realism in three-dimensional objects by combining three elements: diffuse, specular, and ambient lighting for each considered point on a surface.

The reflection model has nothing specific to polygons or pixels, unlike the interpolation method.

Phong shading interpolation example
Phong shading interpolation example

As a rendering method, Phong shading can be regarded as an improvement on Gouraud shading that provides a better approximation to a point-by-point application of an underlying reflection model by assuming a smoothly varying surface normal vector. The Phong interpolation method works better than Gouraud shading when applied to the Phong reflection model or to any reflection model that has small specular highlights.

The main problem with Gouraud shading is that when a specular highlight occurs near the center of a large triangle, it will usually be missed entirely, due to the interpolation of colors between vertices. This problem is fixed by Phong shading.

We are given three vertices in two dimensions, v1, v2 and v3, as well as surface normals for each vertex n1, n2 and n3; we assume these are of unit length. Unlike Gouraud shading, which interpolates colors across triangles, in Phong shading we linearly interpolate a normal vector N across the surface of the triangle, from the three given normals. This is done for each pixel in the triangle, and at each pixel we normalize N and use it in the Phong illumination model to obtain the final pixel color.

In some modern hardware, variants of this algorithm are called "pixel/fragment shading." It usually means that the lighting calculations can be done per-pixel, and that the lighting variables (including surface normals or some approximately equivalent vector) are interpolated across the polygon.

Advanced Search
Included Web Search Engines


Safe Search

close

Top Matching Results

Occasionally Search.com will highlight specialized results that are based on the context of your query. Examples of specialized results include specific links to news, images, or video.

Top Matching Results may highlight information from other Search.com pages, content from the CNET Network of sites, or third party content. The listings are based purely on relevance. Search.com does not receive payment for listings in this section but our partners that provide this data may get paid for listing these products.

Sponsored Links

This section contains paid listings which have been purchased by companies that want to have their sites appear for specific search terms and related content. These listings are administered, sorted and maintained by a third party and are not endorsed by Search.com.

Search Results

Search.com sends your search query to several search engines at one time and integrates the results into one list which has been sorted by relevance using Search.com's proprietary algorithm. You can customize the list of search engines included in your metasearch from the preferences.

The search engines that are used in your metasearch may allow companies to pay to have their Web sites included within the results. To view the Paid Inclusion policy for a specific search engine, please visit their Web site. Search.com does not accept payment or share revenue with any search engine partner for listings in this section.