全局光照

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. once classic example is ‘color bleeding’ where, for example, sunlight hitting a red sofa will casuse 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.

global illumination 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 calcualte indirect light only for objects and surfaces that are known ahead of time to not move around (that are static). thay way the slow computation can be done ahead of time, but since the objects do not move, the indirect light that is pre-calcualted 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 precalcualted and stored (baked). in addition to indirect light, bakded gi also takes advantage of the greater computation time avaiable to generate more realistic soft shadows from area lights and indirect light than what can normally be archieved with realtime techniques.

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 does not 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 later use.

the final lighting is done at runtime by feeding the actual lights present into these previously computed light propagation paths.

this means that the number and type of lights, their position, direction and other propertiers can all be changed and the indirect lighting will update accrodingly. similarly it is also possible to change material properties of obejcts, such as their color, how much light they emit themselves.

limitations of gi

both baked gi and precomputed realtime gi have the only static objects can be included in the bake/precomputation— so moving objects can not bounce light onto other objects and vice versa.反之亦然

however they can still pick up bounce light from static objects using LightProbes. light probes are positions in the scene where the light is measured (probed) during the bake/precompuation, and then at runtime the indirect light that hits non-static objects is approximated using the values from the probes

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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值