我正在学习从头开始编写着色器程序,现在我正在使用漫射照明。目前方程是
Diffuse Intensity = Intensity of light * 'k' diffuse constant of material * (dot product of surface's normal vector and light direction vector)
问题是,我读过白色材料的 k 常数为 1,如果材料为黑色,则 k 为 0。现实世界的情况并非如此,因为当我将黑色物体暴露在光线下时,它确实变亮了来源。为什么算法是这样的?
我正在从这个链接学习,它教如何在 Unity 中编写 GLSL。我可以更轻松地设置场景,以便在 Unity 中使用着色器进行试验。 http://en.wikibooks.org/wiki/GLSL_Programming/Unity/Diffuse_Reflection