Lighting Window 光照设置界面 光照系列2

本文档详细介绍了Unity的Lighting Window,包括场景、全局地图和对象地图的设置,如实时光照、混合光照、光照图和环境光照等。通过调整这些设置,可以优化场景的全局照明效果,控制光晕、cookie和雾等元素。

Lighting Window 光照设置界面

本文档主要是对Unity官方手册的个人理解与总结(其实以翻译记录为主:>)
仅作为个人学习使用,不得作为商业用途,欢迎转载,并请注明出处。
文章中涉及到的操作都是基于Unity2018.3版本
参考链接:https://docs.unity3d.com/Manual/GlobalIllumination.html

The Lighting window (menu: Window > Rendering > Lighting Settings) is the main control point for Unity’s Global Illumination (GI) features. Although GI in Unity gives good results with default settings, the Lighting window’s properties allow you to adjust many aspects of the GI process, to customise your Scene or optimise for quality, speed and storage space as you need. This window also includes settings for ambient light, halos, cookies and fog.
光照窗口(菜单:窗口>渲染>照明设置)是Unity全局照明(GI)功能的主要控制界面。虽然Unity中的GI在默认设置下提供了很好的效果,但是光照窗口的属性允许你调整GI处理的许多方面,来定制你的场景,或者根据你的需要优化质量、速度和存储空间。该窗口还包括环境光、光晕、剪影(cookie)和雾的设置。

Overview 概述

The controls of the Lighting window are divided among three tabs:

  • The Scene tab settings apply to the overall Scene rather than individual GameObjects. These settings control lighting effects and also optimisation options. 场景选项卡设置应用于整个场景,而不是单个游戏对象。这些设置控制灯光效果和优化选项。
  • The Global maps tab shows all of the lightmap Asset files generated by the GI lighting process. Global maps选项卡显示GI照明过程生成的所有lightmap资产文件。
  • The Object maps tab shows previews of GI lightmap textures (including shadow masks) for the currently selected GameObject. 对象地图选项卡显示当前选中的游戏对象的GI lightmap纹理(包括阴影遮罩)预览。

The window also has an Auto Generate checkbox below the displayed content. If you tick this checkbox, Unity updates lightmap data as you edit the Scene. Note that the update usually takes a few seconds rather than happening instantaneously. If you leave the Auto Generate box unticked, the Generate Lighting button to the right of the checkbox becomes active; use this button to trigger lightmap updates when you need them. Use the Generate Lighting button if you want to clear the baked data from the Scene without clearing the GI Cache.
该窗口还在显示内容下方有一个自动生成复选框。如果你勾选这个复选框,Unity会在你编辑场景时自动更新光照图数据。注意,更新通常需要几秒钟,而不是立即发生。如果不勾选“自动生成”框,复选框右侧的“生成照明”按钮将变为活动状态;当你需要的时候,使用这个按钮来触发光照图更新。如果您想在不清除GI缓存的情况下清除场景中烤好的数据,请使用Generate Lighting按钮。

Scene tab

The Scene tab contains settings that apply to the overall Scene, rather than individual GameObjects. The Scene tab contains several sections:

  • Environment 环境
  • Realtime Lighting 实时光照
  • Mixed Lighting 混合光照
  • Lightmapping Settings 光照图设置
  • Other Settings 其他设置
  • Debug Settings 调试设置

Environment 环境

The Environmental Lighting section contains settings for the skybox, diffuse lighting and reflections.
环境光照部分包含天空盒、漫射光照和反射的设置。
在这里插入图片描述

Property Function
Skybox Material A skybox is a Material that appears behind everything else in the Scene to simulate the sky or other distant background. Use this property to choose the skybox Material you want to use for the Scene. The default value is the Material Default-Skybox in the Standard Assets.
### 如何在 Unity 2019 中设置光照贴图的压缩格式 在 Unity 2019 中,光照贴图的压缩格式取决于所选的质量级别以及目标平台的支持情况。以下是关于如何配置光照贴图压缩格式的相关信息: #### 光照贴图质量级别的影响 Unity 提供了三种光照贴图质量设置:High Quality、Normal Quality 和 Low Quality。这些设置直接影响生成的光照贴图格式及其存储方式。 - **High Quality**: 当选择此模式时,生成的光照贴图将以浮点型 HDR 贴图的形式保存,在 Windows 平台上通常采用 BC6H 压缩格式(Direct3D11 支持的一种高效压缩方案)[^1]。 - **Normal Quality**: 此模式下的光照贴图会被编码为 RGBM 格式的 32 位贴图,适用于大多数现代设备并提供良好的性能平衡。 - **Low Quality**: 对于资源受限的情况,可以选择该选项以减少内存占用;在这种情况下,光照贴图将作为 DLDR 编码的 32 位贴图生成。 #### 针对不同平台的纹理压缩行为 除了全局质量设定外,实际使用的压缩算法还受到目标运行环境的影响。例如: - 在 Android 设备上: - 如果光照贴图无透明通道,则优先尝试 ETC1 压缩; - 若存在 Alpha 通道则切换至更高级别的 ETC2 或 RGBA32 (如果分辨率不符合标准)[^2]。 - 对应 iOS 的处理逻辑类似但有所区别——主要依赖 PowerVR Texture Compression(PVRTC),即分别针对有无Alpha决定是否启用RGBA版本还是基础版RGB形式,并同样具备回退机制以防异常状况发生[^2]。 #### 实际操作指南 为了手动调整上述特性,开发者可以通过以下途径实现自定义控制: 1. 开启烘焙流程前确认当前项目的`Quality Settings`已适配预期需求(可通过Edit->ProjectSettings->Quality访问)。 2. 进入具体场景编辑状态后执行 baking 操作之前务必指定恰当的 lighting preset 文件(`Lighting -> Scene -> New Lighting Settings`)以便记录相关偏好项[^3]. 3. 利用 `Window -> Rendering -> Light Transport` 界面进一步微调涉及对象属性比如间接光强度贡献比例等细节参数[^4],尽管这部分更多关联渲染效果而非单纯文件规格转换过程. 最后值得注意的一点在于官方文档里提到过有关各操作系统兼容性的考量因素列表可供查阅参考[^5],从而帮助我们更好地理解整个生态系统内部运作原理的同时也能做出更加明智的技术决策. ```csharp // 示例代码展示如何通过脚本动态修改光照贴图品质等级 using UnityEngine; public class SetLightmapResolution : MonoBehaviour { void Start() { LightmapEditorSettings.lightmapsBakeMode = LightmapsBakeMode.Baked; // 设置烘培模式为 Baked } } ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值