Version: 2019.1
Lightmapping Settings
渐进 CPU 光照贴图 (Progressive CPU Lightmapper)

渐进 GPU 光照贴图 (Progressive GPU Lightmapper)(预览)

注意:这是一个预览功能,将来可能会更改。如果有使用此功能的场景,可能需要在以后的发行版中更新这些场景。在该功能尚未正式发布之前,请勿在大规模生产环境中依赖此功能。

The GPU Lightmapper gives you an interactive workflow when you’re setting up and tweaking the lighting in your Scene. Because this lightmapper uses the GPU in your computer to generate baked lightmaps and Light probes, it’s a faster alternative to the CPU Progressive Lightmapper. Sampling and noise patterns look slightly different than those produced by the CPU lightmapper, because the sampling algorithm is different.

设置

To use the Progressive GPU (Preview) Lightmapper, go to Window > Rendering > Lighting Settings, navigate to Lightmapping Settings, and set Lightmapper to Progressive GPU (Preview). See Lightmapping Settings for more information about this window.

The properties available in the Lighting windows Lightmapping Settings when Lightmapper is set to Progressive GPU (Preview)
The properties available in the Lighting window’s Lightmapping Settings when Lightmapper is set to Progressive GPU (Preview)
属性: 功能:
Prioritize View 启用此设置可使渐进光照贴图程序将更改应用于 Scene 视图中当前可见的纹素,然后将更改应用于视图外的纹素。
Multiple Importance Sampling 启用此设置可将多重重要性采样方法用于对环境采样。通常,这会在生成光照贴图时加快收敛速度,但在某些低频环境中会产生噪声较大的结果。默认处于禁用状态。
Direct Samples 从每个纹素截取的样本(路径)数。此设置可控制渐进光照贴图程序用于直接光照计算的样本数。增加此值可以提高光照贴图的质量,但会延长烘焙时间。
Indirect Samples 从每个纹素截取的样本(路径)数。此设置可控制渐进光照贴图程序用于间接光照计算的样本数。对于某些场景,尤其是室外场景,100 个样本应该足够了。对于具有发射性几何体的室内场景,请增加该值,直到看到所需的结果。
Environment Samples Define the number of samples the lightmapper uses for environment lighting calculations. Higher values can improve the quality of the lightmaps, but increase the time required for baking to complete. This is set to 500 by default.
Bounces 使用此值来指定在追踪路径时要执行的间接反弹次数。对于大多数场景,两次反弹就足够了。对于某些室内场景,可能需要更多次反弹。
Filtering Configure the way the Progressive Lightmapper applies post-processing to lightmaps to limit noise. For lightmap post-processing, the lightmap is split into Direct, Indirect and Ambient Occlusion targets that Unity applies post-processing to individually, before it composites them together into a single lightmap.

- Direct: Any light that arrives directly from a Light to a sensor (usually the Camera).
- Indirect: Any light that arrives indirectly from a Light to a sensor. This most commonly applies to light that reflects off other GameObjects.
- Ambient Occlusion: Any ambient light that the lighting system calculates. See Ambient Occlusion for more information.

The Progressive Lightmapper supports the NVIDIA OptiX AI-Accelerated Denoiser, which reduces perceptible noise in the lightmap without causing blurring. It requires an NVIDIA GPU with 4GB+ VRAM and driver version 390+. It is not supported for the NVIDIA Series 20x GPUs (Turing RTX). It is only supported on the Windows platform.
选择此设置表示不对光照贴图应用过滤和进行去噪。
Auto 选择此设置表示将依赖于平台的预设用于对光照贴图进行后期处理。
如果开发计算机满足运行 OptiX (NVIDIA OptiX AI-Accelerated Denoiser) 的要求,渐进光照贴图程序将此降噪器与 Gaussian 过滤器结合使用。对于所有目标,该过滤器的半径均为 1 纹素。
如果开发计算机无法运行 OptiX,渐进光照贴图程序将使用 Gaussian 过滤器。对于 DirectIndirectAmbient Occlusion 目标,该过滤器的半径分别为 1 纹素、5 纹素和 2 纹素。
Advanced 选择 Advanced 可为每种类型的光照贴图目标手动配置选项。目标类型为 DirectIndirectAmbient Occlusion。有关更多信息,请参阅下文的高级过滤设置

高级过滤设置

Filtering 设置为 Advanced 时可用的 Filtering 设置。
Filtering 设置为 Advanced 时可用的 Filtering 设置。
设置 描述
Advanced Set Filtering to Advanced to manually configure options for each type of lightmap target. The target types are:

- Direct: Any light that arrives directly from a Light to a sensor (usually the Camera).
- Indirect: Any light that arrives indirectly from a Light to a sensor. This most commonly applies to light that reflects off other GameObjects.
- Ambient Occlusion: Any ambient light that the lighting system calculates. See Ambient Occlusion for more information.
Denoiser Select a denoiser to use for the lightmap target:
- Optix: If your development machine fulfils the requirements to support the NVIDIA OptiX AI-Accelerated Denoiser, you can select it here. If your system cannot run it, this option is greyed out and set to None by default.
- None: Select this to use no denoising for the lightmap target.
Filter 选择要用于光照贴图目标的过滤器:
- Gaussian:选择此选项可将 Gaussian 过滤器用于光照贴图目标。Gaussian 过滤器将双向 Gaussian 过滤器应用于光照贴图。这会使光照贴图模糊并减少可见噪点。
- A-Trous:选择此选项可将 A-Trous 过滤器用于光照贴图目标。A-Trous 过滤器可以将模糊程度降至最低,同时可以消除光照贴图中的可见噪点。
- None选择此选项可禁用对光照贴图目标的所有过滤。
Radius 仅当 Filter 设置为 Gaussian 时,此选项才可用。使用 Radius 值可设置 Gaussian 过滤器内核的半径(以纹素为单位)。较高的 Radius 值可以提高模糊强度并减少可察觉的噪点,但可能导致光照中的细节丢失。
Sigma 仅当 Filter 设置为 A-Trous 时,此选项才可用。使用 Sigma 值可调整保留细节或使光照模糊的程度。较高的 Sigma 值可以提高模糊强度并减少可察觉的噪点,但可能导致光照中的细节丢失。

硬件和软件要求

要使用渐进 GPU 光照贴图,计算机必须具有:

  • 至少一个支持 OpenCL 1.2 的 GPU
  • 至少 2GB 的专用 GPU 内存
  • 一个支持 SSE4.1 指令的 CPU

If your computer has more than one GPU, Unity selects the same GPU that the Editor uses. It is possible to choose one GPU for rendering and a different GPU for light baking. For information on how to change this, see the section below, Configure which GPU to use.

Note: If the baking process uses more than the available GPU memory, the process can fall back to the CPU Lightmapper. Some graphics drivers with virtual memory support swap to CPU memory instead, which makes the baking process slower.

配置要使用的 GPU

It is possible to select one GPU for rendering the Scene and another GPU for baking lighting. If the automatic GPU assignment don’t fit your needs, you can specify which graphics card to use for baking.

To see which GPU Unity currently uses for baking, in the Editor: In your Project, open the Lighting window. Next to Bake Performance, you can see the GPU.

要查看计算机中可用的 GPU,请执行以下操作:

  1. Make sure you’ve selected the Progressive GPU lightmapper in the Editor. 1.在场景中生成光照。 1.打开文件资源管理器,然后导航到以下路径:_C:\Users\USER\AppData\Local\Unity\Editor。打开名为 Editor.log_ 的文件。 1.在该文件中,搜索 Listing OpenCL platforms 行。此时应该跳转到日志的一部分,其中包含有关 OpenCL 设备的信息。在此处,可以看到可用的 GPU 及其相应的平台和设备索引。

要选择特定的 GPU 进行烘焙,请在命令行中输入以下命令(用相应的数字替换 platformdevice index):

Unity.exe "-OpenCL-PlatformAndDeviceIndices" <platform> <device index>

在处理场景时,您选择的分配应取决于您的需求。如果将最强 GPU 分配给任一活动,则可能会对其他活动的性能造成影响。如果遇到问题,请尝试重新分配 GPU。

Progressive GPU limitations

渐进 GPU 光照贴图 (Progressive GPU Lightmapper) 不支持:

  • Baked LOD
  • A-Trous filtering (it only uses Gaussian filtering)
  • 自定义烘焙 API(实验性)
  • Submeshes (the lightmapper uses Material properties on the first submesh)

  • 2019–05–07 页面已发布并进行了编辑审查

  • 2019–04–18 页面已发布并进行了编辑审查

  • 2018.3 版中添加了渐进 GPU 光照贴图 (Progressive GPU Lightmapper) 的预览 NewIn2018X

Lightmapping Settings
渐进 CPU 光照贴图 (Progressive CPU Lightmapper)