Unity5.5 Lighting Scene

参考:https://docs.unity3d.com/Manual/GlobalIllumination.html

Environment Lighting(环境光)

Skybox:

天空盒材质,这里天空盒材质unity提供3种shader,6面盒子,cubemap,第三种是程序生成的可以通过调整shader参数生成白天黑夜的天空盒


Sun:

里面指定一个Light,如果不知道,就会默认选择场景中最亮的那个,估计是用来参与计算环境光


AmbientSource:

环境光(源),这里可以选择3个不同选项来影响环境光
Skybox:通过天空盒影响
Gradient:选择这个就出出现3个选项,分别是天空色,赤道色,地表色,通过这3个过渡色影响环境光
Color:通过固定颜色影响

可以通过调整
Ambient Intensity来调整影响强度


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占用率

这两个参数都要看设备性能和效果来调整了

This lets you set the approximate amount of CPU time that should be spent evaluating realtime GI at runtime. Higher CPU usage results in faster reactions from the lighting but may affect framerate , etc. This does not affect the CPU usage for the precomputation process performed in the editor. Note that higher CPU usage is achieved by increasing the number of threads assigned to the GI; processors with many cores may therefore suffer less of a performance hit.

使用更高的cpu占用率可能会影响帧率。更高的cpu占用率选项通过增加GI相关线程数实现,所以对于多核心处理性能影响小。


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时间


Atlas Size:

这个不需要解释


Light Probes:

AddDirect Light
文档无说明


General GI

生成全局光照GI

Directional Mode:

方向模式,3个选择
Non-Directional:关掉下面两个选项
Directional:多生成一张保持主要光源方向信息的图,会产生2倍的lightmap的附加数据
Directional Specular:存储更多信息,4倍附加数据,2倍内存

Indirect Intensity:

调整最终lightmap中间接光照(环境反射光,物体反射光,物体自发光等)强度
从文档using precomputed lighting中能看出这个indirect light就是指设置为realtime的light,经过precomputed gi处理后的间接光照


Bounce Boost:

增加Light Bounces (光在物体上多次弹射)数量,默认是1

Default Parameters:

这里可以选择或自定义一些生成lightmap时的附加属性,(自定义属性比较多 ,先不看)



Fog


Other Settings

Halo这个可以用自定义贴图给场景中物体做标签





  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值