着色(光照与基本着色模型)
着色和阴影无关
Shading:The process of applying a material to an object.
Diffuse
Lambertian (Diffuse) Shading
$$ L_{d}=k_{d}\left(I / r^{2}\right) \max (0, \mathbf{n} \cdot \mathbf{l}) $$
Specular
Ambient
$$ L_{a}=k_{a} I_{a} $$
合起来:
$$ \begin{aligned} L &=L_{a}+L_{d}+L_{s} \\ &=k_{a} I_{a}+k_{d}\left(I / r^{2}\right) \max (0, \mathbf{n} \cdot \mathbf{l})+k_{s}\left(I / r^{2}\right) \max (0, \mathbf{n} \cdot \mathbf{h})^{p} \end{aligned} $$
Shading is Local:对某个点进行计算,局部,只看自己,不管其他物体的存在
光的能量密度的 平方反比定律
点离观察点的距离无关