高光反射公式推导
(图片来自《Unity Shader入门精要》随书彩色插图 )图6.3 使用Phong模型计算高光反射在看《Unity Shader入门精要》时,高光反射向量https://math.jianshu.com/math?formula=%5Chat%7Br%7D%20%3D%202(%5Chat%7Bn%7D%5Cbullet%20%5Chat%7Bl%7D)%20%5Chat%7Bn%7D%20-%20%5Chat%7Bl%7D
该公式的推导过程:
https://math.jianshu.com/math?formula=%5Chat%7Br%7D%20%3D%20%5Chat%7Bl%7D%20-%202%5Chat%7Bm%7D%20%20
https://math.jianshu.com/math?formula=%5Chat%7Bm%7D%20%3D%20%5Chat%7Bl%7D%20-%20%5Chat%7Bn%E2%80%99%20%7D%20%20
(图片来自《Unity Shader入门精要》随书彩色插图 )图4.22 矢量b在单位矢量a方向上的投影
https://math.jianshu.com/math?formula=%5Chat%7Bn%E2%80%99%20%7D%20%20%3D%20(%5Chat%7Bn%7D%20%5Cbullet%20%5Chat%7Bl%20%7D)%5Chat%7Bn%7D%20%20(注:https://math.jianshu.com/math?formula=%5Chat%7Bn%7D%20%5Cbullet%20%5Chat%7Bl%20%7D是https://math.jianshu.com/math?formula=%5Chat%7Bn%7D%20上https://math.jianshu.com/math?formula=%20%5Chat%7Bl%20%7D的投影的标量 )
所以
https://math.jianshu.com/math?formula=%5Chat%7Br%7D%20%3D%20%5Chat%7Bl%7D%20-%202(%5Chat%7Bl%7D%20-%20(%5Chat%7Bn%7D%20%5Cbullet%20%5Chat%7Bl%20%7D)%5Chat%7Bn%7D%20%20)%0A
https://math.jianshu.com/math?formula=%5Chat%7Br%7D%20%3D%202%20(%5Chat%7Bn%7D%20%5Cbullet%20%5Chat%7Bl%20%7D)%5Chat%7Bn%7D%20-%20%5Chat%7Bl%7D
页:
[1]