这听起来有些复杂,其实很简单,举例说明:如果你将光源至被摄主体的距离增加1倍,那么落在主体上的光线只有距离增加前的四分之一。
That sounds complicated, but isn't really. If you move a light twice as far from your subject, you end up with only one-quarter of the light on the subject.
最终渲染阶段产生最后渲染后的图像,到这一步,所有的对象都将被再次渲染,其中着色器将混合前一步生成的光源和纹理以及所有自发光照明。
Final pass produces final rendered image. Here all objects are rendered again; with shaders that fetch the lighting, combine it with textures and add any emissive lighting.
函数的源代码如下。注意如果光源是方向光,向量的前三个部分将被归一化,来节省时间。
The source code is presented next. Note that if the light is a directional light, the vector with the first three components is normalised to save time latter.
应用推荐