首页 > 其他 > 详细

Phong Shading

时间:2014-08-03 12:43:25      阅读:437      评论:0      收藏:0      [点我收藏+]

Phong Shading

  The most serious problem with Gouraud shading occurs when specular highlights are found in the middle of a large polygon. Since these specular highlights are absent from the polygon‘s vertices and Gouraud shading interpolates based on the vertex colors, the specular highlight will be missing from the polygon‘s interior. This problem is fixed by Phong shading.

  相比Gouraud,Phong Shading能更好地解决镜面照问题。

  Unlike Gouraud shading, which interpolates colors across polygons, in Phong shading a normal vector is linearly interpolated across the surface of the polygon from the polygon‘s vertex normals. The surface normal is interpolated and normalized at each pixel and then used in a reflection model, e.g. the Phong reflection model, to obtain the final pixel color. Phong shading is more computationally expensive than Gouraud shading since the reflection model must be computed at each pixel instead of at each vertex.

  顶点色=GlobalAmbient*kAmbientColor + LiVec*Normal*kDiffuseColor + RefVec*ViewVec*kSpecularColor

Blinn-Phong

  相比于Phong,镜面光照公式改为下面这个:

  MidVec*Normal*kSpecularColor。

  MidVec指LiVec和ViewVec的中间向量。Blinn-Phong比Phong略快。

参考:

1、http://en.wikipedia.org/wiki/Phong_shading

2、http://en.wikipedia.org/wiki/Phong_reflection_model

3、http://en.wikipedia.org/wiki/Blinn%E2%80%93Phong_shading_model

Phong Shading,布布扣,bubuko.com

Phong Shading

原文:http://www.cnblogs.com/tekkaman/p/3888188.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!