我在3D引擎中安装照明设备,发现我计算照明的方法有缺陷。在混合遮光镜中,我得到分散的颜色和照明计算。
return diffuseColor * (diffuseLight + ambient);
As far as I can tell, this is the standard way of doing things. But, for example, what if the color is 0,1,0, and the light is 1,0,0. (Ignore ambient in this example) The result would be 0,0,0. But in real life, if I get a pure green bit of paper, and shine a tinted red light onto it, it should turn out yellow. Or at least not black.
其他游戏如何解决这个问题?