Blinn–Phong vs Phong

Phong

1975 Illumination for Computer Generated Pictures

S_p = C_p(cos(i) * (1 - d) + d) + W(i) * pow(cos(s), n)

Blinn-Phong

1977 Models of Light Reflection for Computer Synthesized Pictures

i = P_a + d * P_d + s * P_s
d = max(0, dot(N, L))
s = pow(cos(N, H), c_1)
H = (L + V) / 2

Jim Blinn 对 Phong 模型的改进在于高光部分:cos(V, R) => cos((L+V)/2, N) 。

好处在于:

  1. angle(V, R) 的取值范围在 [0, 180°],cos 值可能为负,此时用 max or clamp 直接截断会导致明显的明暗边缘。而 angle((L+V)/2, N) 的取值范围在 [0, 90°],cos 值不可能为负,所以明暗过渡平滑。
  2. 半程向量比反射向量计算量小。

WebGL Phong Shading demo 测试一下效果:

明暗过渡问题:

【Jim Blinn 是个非常有趣的人,他的 Jim Blinns Corner 系列都是用自己的表情包作封面hhhh】

原文地址:https://www.cnblogs.com/tandandan/p/15076327.html