Unity Graphics (Unity 图形渲染 ) 官方教程文档笔记系列之十一

Unity Graphics (Unity 图形渲染 )
- Everything for Lighting and Rendering in Unity
- 主要涉及到光照与渲染方面的知识

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


下面是将要介绍的章节,黑体是本次内容:

  • Introduction to Lighting and Rendering
    介绍光照和渲染
  • Precomputed Realtime GI (Realtime Global Illumination)(11)
    预处理实时全局光照(11)
  • Rendering and Shading
    渲染与着色
  • Cameras and Effects
    相机与效果
  • Geometry in Unity
    几何体

9.Fine tuning with Lightmap Parameters
微调光照图参数

Many of the advanced lightmapping controls offered by Unity are available through the use of Lightmap Parameters. These settings are stored within a Lightmap Parameters asset. This allows lighting settings to be shared between Scenes and version controlled for shared use in collaborative team environments.
Unity提供的许多高级光照图控制都可以通过光照图参数来配置。这些设置存储在光照图参数资产中。这使得光照设置可以在场景之间共享,而版本控制又可以让其在协作团队环境中共享使用。

  • To create a Lightmap Parameters Asset, navigate to the Project window.
    要创建光照图参数资产,请导航到项目窗口。
  • From the Create drop-down menu in the top left of the Project window, choose (Create > Lightmap Parameters).
    项目窗口左上角Create下拉菜单,选择(Create > Lightmap Parameters)
  • We can also create a Lightmap Parameters asset from the right-click menu within the Project window, or from the top menu bar (Asset > Create > Lightmap Parameters).
    也可以右击项目窗口,选择(Create > Lightmap Parameters)
    在这里插入图片描述
    Advanced controls for both Baked GI and Precomputed Realtime GI are made available through Lightmap Parameters.
    通过光照图参数提供了烘焙GI和预计算实时GI的高级控制。

Once created, a Lightmap Parameters asset can then be assigned to a Static MeshRenderer component.
一旦创建好,光照图参数资产就可以分配给一个静态的MeshRenderer组件。

  • Select the GameObject that we wish to assign the Lightmap Parameters asset to in the Hierarchy window. The GameObject must be marked as Static and have a MeshRenderer component.
    选择我们希望在层次结构窗口中分配光照图参数资产的GameObject。GameObject必须被标记为Static,并具有MeshRenderer组件。
  • Open the Lighting window (Window > Lighting) and select the Scene tab.
    打开照明窗口(窗口>照明)并选择Object选项卡。
  • Use the Advanced Parameters drop-down menu to assign the Lightmap Parameters Asset to the GameObject. The ‘Edit’ button to the right of the Advanced Parameters drop-down menu can be used as a shortcut to modifying the Lightmap Parameters assigned to the selected object.
    使用Lightmap Parameters下拉菜单将光照图参数资产分配给GameObject。光照图参数下拉菜单右侧的“编辑”按钮可以作为修改分配给所选对象的光照映射参数的快捷方式。
    在这里插入图片描述
    Lightmap Parameters are assigned using the Advanced Parameters drop-down from the Object tab of the Lighting window.(新版本已移到mesh renderer组件上)

The same Lightmap Parameters asset can be assigned to multiple objects. To do this, select multiple objects in the Hierarchy window and then follow the steps above. Changes to this Lightmap Parameter asset will then affect all objects to which it is assigned.
相同的光照图参数资产可以分配给多个对象。为此,在Hierarchy窗口中选择多个对象,然后按照上面的步骤进行操作。对光照图参数资产的更改将影响分配给它的所有对象。

Lightmap Parameters: per-instance or per-Prefab?
光照图参数:每个实例还是每个预置体?

Similar to unwrap settings, Lightmap Parameters assets can be assigned to a Prefab or applied to individual GameObject instances within the Scene. Lightmap Parameters assets applied to an instance of a Prefab in a Scene will override the Lightmap Parameters asset stored in the Prefab.
与展开设置类似,光照图参数资产可以分配给预置体或应用到场景的单个GameObject实例。应用于场景中预制体实例的光照图参数资产将覆盖预制体中存储的光照图参数资产。

The advantage of this approach is that default Lightmap Parameters that are suitable for most cases can be applied to the Prefab. These defaults can then be overridden on a case-by-case basis in the Scene when more fine-grained control is needed.
这种方法的优点是,适用于大多数情况的默认光照图参数可以应用于预制体。当需要更细粒度的控制时,这些默认值可以在场景中逐项重写。

In this tutorial, we have chosen to apply Lightmap Parameters assets on a per-instance basis. This is because we want to select different Lightmap Parameters assets depending on the context in which each GameObject is used.
在本教程中,我们选择在每个实例的基础上应用光照图参数资产。这是因为我们希望根据每个GameObject 的上下文选择不同的光照图参数资产。

Default Parameters

It is possible to configure Scene-wide default Lightmap Parameters. These default Lightmap Parameters will be assigned to all existing MeshRenderers within a Scene not already assigned a Lightmap Parameters asset. Any MeshRenderers that are then created in the Scene will also use the default Lightmap Parameters. Using this approach reduces the amount of manual assignment which needs to be performed when setting up a Scene for lighting.
可以配置场景范围内的默认光照图参数。这些默认的光照图参数将被分配给场景中尚未分配光照图参数资产的所有现有网格渲染器。在场景中创建的任何网格渲染器都将使用默认的光照图参数。使用这种方法可以减少设置光照场景时需要执行的手动分配。

  • Open the Lighting window (Window > Lighting) and select the Scene tab.
    打开照明窗口(Window > Lighting)并选择场景选项卡。
  • Use the Default Parameters drop-down menu to assign the Lightmap Parameters asset to the Scene.
    使用默认参数下拉菜单将光照图参数资产分配给场景。

Note that although this Default Parameter will be applied to all newly created objects, it can still be overridden on individual objects by assigning an Advanced Parameter to the object, as described above.
注意,尽管这个默认参数将应用于所有新创建的对象,但是它仍然可以通过向对象分配高级参数来覆盖这个对象,如上所述。
在这里插入图片描述
The Default Parameters will be assigned to all newly-created Static Mesh Renders.
默认参数将分配给所有新创建的静态网格渲染。

Unity provides a number of preconfigured Lightmap Parameters to help quickly set up Scene lighting. These are:
Unity提供了一些预配置的光照图参数来帮助快速设置场景光照。这些都是:

  • Default - HighResolution 高分辨率
  • Default - Medium 中分辨率
  • Default - LowResolution 低分辨率
  • Default - VeryLowResolution 很低分辨率

Assigning one of these Lightmap Parameters will configure a number of settings that determine the overall lighting cost of the selected object. These settings include lightmap resolution, global illumination parameters and Cluster resolution, amongst other advanced per-object settings. These are important factors when trying to balance lighting performance throughout a Scene.
指定这些光照图参数之一将配置一些被此设置影响的对象,以确定所选对象的总体光照成本。这些设置包括光照图分辨率、全局光照参数和群集分辨率,以及其他每个对象高级设置。在试图平衡整个场景的光照效果时,这些都是重要的因素。

Lightmap Parameters explained
光照图参数解释

Unity’s Default Parameters are intended to cover a number of common use cases and will be generally enough for many lighting scenarios. More fine-grained control over the Precomputed Realtime GI system can be achieved by creating our own Lightmap Parameters assets.
Unity的默认参数是为了涵盖大部分常见的用例,并且对于许多光照情景来说已经足够了。通过创建我们自己的光照图参数资产,可以实现对预计算的实时GI系统的更细粒度控制。

The Unity Manual page on Lightmap Parameters provides an overview of all of the settings contained within the Lightmap Parameters asset. However, in this tutorial, we will focus on the settings that are most useful for lighting optimization.
光照图参数的Unity手册页提供了光照图参数资产中包含的所有设置的概述。然而,在本教程中,我们将重点关注对光照优化最有用的设置。

Resolution分辨率

The Resolution value determines the lightmap resolution required by objects using this Lightmap Parameter. Resolution is a multiplier used against the Scene-wide Realtime Resolution specified in the Scene tab of the Lighting window. For example, if the Scene’s Realtime Resolution is set to 2, and the Resolution property is set to 0.5, any objects which are assigned this Lightmap Parameter will use 1 texel per unit in the resulting lightmap texture.
分辨率值确定对象使用这个光照图参数所需的光照图分辨率。此分辨率是一个倍增器,用于光照窗口的场景选项卡中指定的场景范围内的实时分辨率。例如,如果场景的实时分辨率设置为2,而分辨率属性设置为0.5,那么任何被赋予这个光照图参数的对象都会在生成的光照图纹理中使用每单元1纹素。

As Precomputed Realtime GI represents only the diffuse, indirect lighting within a Scene, we do not need to use the resolutions required by traditional baked lightmapping approaches. The lightmap resolution required by Precomputed Realtime GI will generally be 2-3 texels per unit as a maximum, as opposed to the 20-30 texels per unit we mig

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值