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 Enable this to make the Progressive Lightmapper apply changes to the texels that are currently visible in the Scene View, then apply changes to the out-of-view texels.
Multiple Importance Sampling Enable this to use multiple importance sampling for sampling the environment. This generally leads to faster convergence when generating lightmaps, but can lead to noisier results in certain low frequency environments. This is disabled by default.
Direct Samples The number of samples (paths) shot from each texel. This setting controls the number of samples Progressive Lightmapper uses for direct lighting calculations. Increasing this value can improve the quality of lightmaps, but increases the baking time.
Indirect Samples The number of samples (paths) shot from each texel. This setting controls the number of samples Progressive Lightmapper uses for indirect lighting calculations. For some Scenes, especially outdoor Scenes, 100 samples should be enough. For indoor Scenes with emissive geometry, increase the value until you see the result you want.
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 Use this value to specify the number of indirect bounces to do when tracing paths. For most Scenes, two bounces is enough. For some indoor Scenes, more bounces might be necessary.
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.
Select this to use no filter or denoising for the lightmap.
Auto Select this to use a platform-dependent preset for post-processing the lightmap.
If your development machine fulfils the requirements to run OptiX (the NVIDIA OptiX AI-Accelerated Denoiser), the Progressive Lightmapper uses the denoiser with a Gaussian filter that has a 1-texel radius for all targets.
If your development machine cannot run OptiX, the Progressive Lightmapper uses a Gaussian filter that has a 1-texel radius for Direct, 5-texel radius for Indirect, and 2-texel radius for Ambient Occlusion.
Advanced Select Advanced to manually configure options for each type of lightmap target. The targets types are Direct, Indirect and Ambient Occlusion. For more information, see Advanced Filtering settings, below.

Advanced Filtering settings

The available Filtering settings when Filtering is set to Advanced.
The available Filtering settings when Filtering is set to Advanced.
设置 描述
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 Select a filter to use for the lightmap target:
- Gaussian: Select this to use a Gaussian filter for the lightmap target. The Gaussian filter applies a bilateral Gaussian filter on the lightmap. This blurs the lightmap and reduces the visible noise.
- A-Trous: Select this to use an A-Trous filter for the lightmap target. The A-Trous filter minimizes the amount of blur while it removes visible noise in the lightmap.
- None: Select this to disable all filtering for the lightmap target.
Radius This option is only available when Filter is set to Gaussian. Use the Radius value to set the radius of the Gaussian filter kernel in texels. A higher Radius increases the blur strength and reduces the perceptible noise, but might cause detail to be lost in the lighting.
Sigma This option is only available when Filter is set to A-Trous. Use the Sigma value to adjust how much to preserve detail or blur the lighting. A higher Sigma increases the blur strength and reduces the perceptible noise, but might cause detail to be lost in the lighting.

硬件和软件要求

要使用渐进 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)