Global Illumination(全局照明)

Global Illumination (GI) is a system that models how light is bounced off of surfaces onto other surfaces (indirect light) rather than being limited to just the light that hits a surface directly from a light source (direct light). Modelling indirect lighting allows for effects that make the virtual world seem more realistic and connected, since objects affect each other’s appearance. One classic example is ‘color bleeding’ where, for example, sunlight hitting a red sofa will cause red light to be bounced onto the wall behind it. Another is when sunlight hits the floor at the opening of a cave and bounces around inside so the inner parts of the cave are illuminated too.


[翻译]  全局照明(GI)是一种可以模拟光线如何从表面反射到其他表面(间接光线)而不仅仅局限于将光线从光源处直接(直接光照)照射到表面的系统。模拟间接光照可以使虚拟世界看起来有更加真实和联系的效果,因为物体间会影响彼此的表面模样。一个典型的例子是“color bleeding”,例如,阳光照射到红色沙发上会导致红光反射到其后面的墙壁上。另一种情况是阳光照射在洞穴的底部并在内部反弹,因此洞穴的内部也被照亮

U3D用户手册翻译之全局光照

GI in the Scene view. Note the subtle effect of indirect lighting

[翻译]  场景视图中的全局照明。注意间接照明的微妙效果

GI Concepts(全局光照的概念)

Traditionally, video games and other realtime graphics applications have been limited to direct lighting, while the calculations required for indirect lighting were too slow so they could only be used in non-realtime situations such as CG animated films.

A way for games to work around this limitation is to calculate indirect light only for objects and surfaces that are known ahead of time to not move around (that are static). That way the slow computation can be done ahead of time, but since the objects don’t move, the indirect light that is pre-calculated this way will still be correct at runtime.

Unity supports this technique, called Baked GI (also known as Baked Lightmaps), which is named after “the bake” - the process in which the indirect light is precalculated and stored (baked). In addition to indirect light, Baked GI also takes advantage of the greater computation time available to generate more realistic soft shadows from area lights and indirect light than what can normally be achieved with realtime techniques.


[翻译]  传统上,视频游戏和其他实时图形应用仅限于直接照明,而间接照明所需的计算速度太慢,因此它们只能用于非实时情况,例如CG动画电影。

[翻译]  游戏在此限制下能工作的一种方式仅仅是为事先知道的那些不能被移动的物体计算间接光(静态)。这种慢速计算方式之所以可以提前完成,并且预先计算的间接光在运行时能够正确,是因为对象是静止不动的。

[翻译]  Unity支持这种被称为Baked GI(也称为Baked Lightmaps)的技术,以“bake”命名表示间接光被预先计算并存储的过程(被烘焙)。除了间接光之外,相比于实时技术通常能达到的效果,烘焙GI还用了更多的计算时间来产生更真实的来自区域光和间接光的软阴影


Additionally, Unity 5.0 adds support for a new technique called Precomputed Realtime GI. It still requires a precomputation phase similar to the bake mentioned above, and it is still limited to static objects. However it doesn’t just precompute how light bounces in the scene at the time it is built, but rather it precomputes all possible light bounces and encodes this information for use at runtime.

So essentially for all static objects it answers the question “if any light hits this surface, where does it bounce to?” Unity then saves this information about which paths light can propagate by for later use. The final lighting is done at runtime by feeding the actual lights present into these previously computed light propagation paths.


[翻译]  此外,unity5.0还增加了对被称为“预计算实时GI”的新技术的支持。它仍然需要类似于上面提到的烘焙预计算阶段,并且它也只针对静态物体。然而,它并不仅预先计算出在场景构建时光线是如何反射的,而且对可能计算出的所有光反射信息进行编码,以便在运行时使用。

[翻译]  所以对于所有的静态物体来说它回答了一个本质上的问题:”如果有光线照射到表面,那么它会反射到哪里?” 然后,Unity保存了关于光可以沿着哪些路径传播的信息,最终的照明是在运行时通过将实际的光输入到这些事前计算好的光传播路径中完成的。


This means that the number and type of lights, their position, direction and other properties can all be changed and the indirect lighting will update accordingly. Similarly it’s also possible to change material properties of objects, such as their color, how much light they absorb or how much light they emit themselves


[翻译]  这意味着灯的数量和类型以及他们的位置、方向和其他属性发生改变时,间接照明也会相应更新。同样,也可以改变物体的材质属性,比如它们的颜色,它们吸收多少光或者它们发出多少光。


While Precomputed Realtime GI also results in soft shadows, they will typically have to be more coarse-grained than what can be achieved with Baked GI unless the scene is very small.

Also note that while Precomputed Realtime GI does the final lighting at runtime, it does so iteratively over several frames, so if a big a change is done in the lighting, it will take more frames for it to fully take effect. And while this is fast enough for realtime applications, if the target platform has very constrained resources it may be better to to use Baked GI for better runtime performance.


[翻译]  虽未预计算实时GI可以产生柔和的阴影,但是除非场景比较小,否则效果比不上烘培GI。

[翻译]  另请注意,虽然运行时的最终照明受控于预计算实时GI,但它会需要花费好几帧的时间来迭代执行,因此如果在照明中进行了大量更改,则需要花费更多帧才能完全生效。这对于实时应用程序来说已经相当快了,但如果目标平台的资源非常有限,那么使用烘焙GI来获得良好的运行时性能或许是最佳选择。


Limitations of GI(实时光照的不足)

Both Baked GI and Precomputed Realtime GI have the limitation that only static objects can be included in the bake/precomputation - so moving objects cannot bounce light onto other objects and vice versa. However they can still pick up bounce light from static objects using Light Probes.

Light Probes are positions in the scene where the light is measured (probed) during the bake/precomputation, and then at runtime the indirect light that hits non-static objects is approximated using the values from the probes that the object is closest to at any given moment. So for example a red ball that rolls up next to a white wall would not bleed its color onto the wall, but a white ball next to a red wall could pick up a red color bleed from the wall via the light probes.


[翻译]  烘焙GI和预计算的实时GI都有不足之处,只有静态对象可以被包含在烤焙/预计算中——所以移动的对象不能将光反射到其他物体上,反之亦然。但是,他们可以通过使用Light Probes从静态对象中拾取反射光。

[翻译]  光探测器是放置在场景中用于在烘焙或者预计算期间测量(探测)光线的组件,然后在运行时,照射到非静态对象上的间接光线被近似的看成是任意时刻最接近探针的对象上的间接光值。举个例子,一个在白色墙壁旁边滚动的红球不会把红色融合到墙上,但是一个在红色墙壁旁边滚动的白球可以通过光探测器从墙上拾取红色融合在自身上。

相关文章: