参考:https://docs.unity3d.com/Manual/GlobalIllumination.html
Environment Lighting(环境光)
Skybox:
天空盒材质,这里天空盒材质unity提供3种shader,6面盒子,cubemap,第三种是程序生成的可以通过调整shader参数生成白天黑夜的天空盒
Sun:
里面指定一个Light,如果不知道,就会默认选择场景中最亮的那个,估计是用来参与计算环境光
AmbientSource:
Ambient GI:
这个属性必须后面的PrecomputedRealtime GI和Baked GI同时勾选才会生效,unity默认这两个是同时勾上的
如果只有Baked GI那么环境光一定也是Backed,不需要选择
如果只有Precomputed Realtime GI,环境光也必须是Realtime,也不需要选择
只有两者同时存在才需要选
Realtime:实时,实际上不是完全实时,官网文档解释是Precomputed Realtime
Bake:烘培
出于性能考虑,官网建议根据情况只打开precomputed 或者backe gi中的一项
precomputed 或者backe gi同时打开时,使用哪个取决于light的bake选项
Light的baking除了Realtime和bake还可以设置为mix,设置成mix的光既能bake lightmap,也能实时照亮场景中非静态物体比如给主角产生shadow
Reflection Source:
反射源,可以选择skybox和自定义cubemap
如果是skybox会有两个选项,Resolution:生成贴图分辨率,Compression:是否压缩,这两个参数设置就要早效果和性能权衡下,?有空研究具体怎么测试这里的性能
Reflection Intensity:
反射强度0-1
Reflection Bounces:
反射反弹次数,大体的理解是,场景中有多个object,真实的光照情况下,一个object接受到的光照会来自多个object的反射光,unity中用Reflection probe来模拟这种反射情况
这里的反弹次数大致可以理解为,次数越多,就可以接受到更多次object反弹回的光照,也就越逼真
A reflection “bounce” occurs where a reflection from one object is then reflected by another object. The reflections are captured in the scene through the use of Reflection Probes. This property lets you set how many times the bounces back and forth between
objects are evaluated by the probes; if set to 1 then only the initial reflection (from the skybox or cubemap specified in the Reflection Source property) will be taken into account.
Precomputed Realtime GI
预计算实时全局光照,大体概念可以看下Unity 5 中的全局光照技术详解
如果是非固定视角,光源会发生颜色位置变化等,要想效果真实,并要性能可接受,可以使用这个
只有设置为static的geometry才可以好似用这个技术
如果未开启自动烘培,设置改动后precomputed需要点击build才能生效
Realtime Resolution:
默认 2 texels per unit (unity中一个单位米用每2贴图像素表示)
This sets the number of texels (ie, “texture pixels”) that will be used per unit of length for objects being lit by realtime GI.A resolution of 1 per unit is usually a good value (depending on the size of the objects in the scene) but for terrains and huge objects you will usually want to scale the resolution down. You can use the Lightmap Parameters or the Mesh Renderer’s Scale In Lightmap property to reduce the resolution. Note that thisproperty also sets the Indirect Resolution if both Realtime and Baked GI are enabled - see the Baked GI properties below.
1 texels per unit是比较好的选择, 对于比较大的物体或者terrain,不需要每个单位都产生1 texels,这个通过LightmapPara或者MeshRender里的Scale In Lightmap来调整(在选择1 texels per unit后,个别物体不需要那么高精度贴图时采用的办法)
最后的那个间接分辨率Indirect Resolution没看懂,暂时不知道哪里用,这里indirect Light就是各种反弹出来的间接光,而Indirect Resolution就是Precomputed RealtimeGI贴图的分辨率
CPU Usage:
cpu占用率
Baked GI:
固定视角可以考虑这个
必须是static物体才可烘培到lightmap,unity5.5里面static后面有个下拉列表,包含了多种static,对于lightmap bake只需要选择lightmap static
Backed Resolution:
官方文档:这个参数通常设置为Precomputed Realtime GI中 RealtimeResolution的数值的10倍以上
unity默认把Precomputed Realtime GI中 RealtimeResolution设置为2 而把 BakedGI中Backed Resolution设置为了40
Backed Padding:
不同shape生成的texels在lightmap中的间距,比如场景中一个plane,上面放一个cube,一个设置为bake的平行光,间距设置为10,烘培完效果
Compressed:
是不是压缩看具体效果吧,默认压缩
Ambient Occlusion
是否backed环境光遮挡,比如用几个plane围出一个角落,这个非封闭角落正常应该接受到更少的环境光
backed时勾选这个角落就会通过计算收到更少的环境光,否则就跟其他位置一样
Final Gather:
When the final gather option is enabled, the final light bounce in the GI calculation will be calculated at the same resolution as the baked lightmap. This improves the
visual quality of the lightmap but at the cost of additional baking time in the editor.
简单说就是更好的效果,更长的baked时间