The Li(l) (incoming radiance) term in the reflectance equation (Equation 9.4) represents light impinging upon the shaded surface point from other parts of the scene.Global illumination algorithms calculate Li(l) by simulating how light propagates and is reflected throughout the scene. These algorithms use the rendering equation [846],of which the reflectance equation is a special case. Global illumination is discussed in Chapter 11. In this chapter and the next, we focus on local illumination, which uses the reflectance equation to compute shading locally at each surface point. In local illumination algorithms Li(l) is given and does not need to be computed.
反射率方程(方程9.4)中的Li(l)(入射辐射)项表示从场景的其他部分照射到阴影表面点上的光。全局照明算法通过模拟光线如何在整个场景中传播和反射来计算Li(l)。这些算法使用渲染方程[846],其中反射率方程是一个特例。全局照明将在第11章中讨论。在这一章和下一章中,我们将关注局部照明,它使用反射率方程来计算每个表面点的局部明暗度。在局部照明算法中,Li(l)是给定的,不需要计算。
In realistic scenes, Li(l) includes nonzero radiance from all directions, whether emitted directly from light sources or reflected from other surfaces. Unlike the directional and punctual lights discussed in Section 5.2, real-world light sources are area lights that cover a nonzero solid angle. In this chapter, we use a restricted form of Li(l) comprised of only directional and punctual lights, leaving more general lighting environments to Chapter 10. This restriction allows for a more focused discussion.
在真实场景中,Li(l)包括来自所有方向的非零辐射,无论是直接从光源发出还是从其他表面反射。与第5.2节中讨论的平行光和点光源不同,真实世界的光源是覆盖非零立体角的区域光。在这一章中,我们使用一个限制形式的Li(l ),只包括方向灯和点状灯,将更多的一般照明环境留到第10章。这种限制使得讨论更加集中。
Although punctual and directional lights are non-physical abstractions, they can be derived as approximations of physical light sources. Such a derivation is important,because it enables us to incorporate these lights in a physically based rendering framework with confidence that we understand the error involved.
虽然点光源和平行光是非物理的抽象,但是它们可以作为物理光源的近似。这种推导是很重要的,因为它使我们能够将这些灯光合并到一个基于物理的渲染框架中,并且确信我们理解所涉及的误差。
We take a small, distant area light and define lc as the vector pointing to its center. We also define the light’s color clight as the reflected radiance from a white Lambertian surface facing toward the light (n = lc). This is an intuitive definition for authoring, since the color of the light corresponds directly to its visual effect.
我们取一个小的,远处的区域光源,定义lc为指向其中心的向量。我们还将光的色光定义为从面向光的白色朗伯表面反射的辐射(n = lc)。这是创作的直观定义,因为灯光的颜色与其视觉效果直接对应。
With these definitions, a directional light can be derived as the limit case of shrinking the size of the area light down to zero while maintaining the value of clight [758].In this case the integral in the reflectance equation (Equation 9.4) simplifies down to a single BRDF evaluation, which is significantly less expensive to compute:
有了这些定义,一个平行光可以被导出为在保持clight [758]值的同时将区域光的大小缩小到零的极限情况。在这种情况下,反射率方程(方程9.4)中的积分简化为一次BRDF评估,计算成本显著降低:
The dot product (n·l) is often clamped to zero, as a convenient method of skipping contributions from lights under the surface:
点积(n l)通常固定为零,这是跳过表面下灯光贡献的一种便捷方法:
Note the x+ notation introduced in Section 1.2, which indicates that negative values are clamped to zero.
请注意1.2节中引入的x+符号,它表示负值 被钳制为零。
Punctual lights can be treated similarly. The only differences are that the area light is not required to be distant, and clight falls off as the inverse square of the distance to the light, as in Equation 5.11 (page 111). In the case of more than one light source, Equation 9.12 is computed multiple times and the results are summed:
点状灯也可以类似处理。唯一的区别是区域光不需要很远,并且clight随着到光的距离的平方的倒数而下降,如等式5.11(第111页)。在一个以上光源的情况下,多次计算等式9.12,并将结果相加:
where lci and clighti are the direction and color, respectively, of the ith light. Note the similarities to Equation 5.6 (page 109).
其中lci和clighti分别是第I个光的方向和颜色。注意与等式5.6(第109页)的相似之处。
The π factor in Equation 9.14 cancels out the 1/π factor that often appears in BRDFs (e.g., Equation 9.11). This cancellation moves the divide operation out of the shader and makes the shading equation simpler to read. However, care must be taken when adapting BRDFs from academic papers for use in real-time shading equations.Typically, the BRDF will need to be multiplied by π before use.
方程9.14中的π因子抵消了BRDFs中经常出现的1/π因子(如方程9.11)。这种取消将除法运算移出着色器,并使着色方程更容易阅读。但是,在将学术论文中的BRDFs用于实时着色方程时,必须小心谨慎。通常,BRDF在使用前需要乘以π。