渐进光照贴图程序 (Progressive Lightmapper) 是一种基于路径追踪的光照贴图系统,提供了能在 Editor 中逐渐刷新的烘焙光照贴图和光照探针。要求不重叠的 UV 具有较小的面积和角度误差,以及棋盘格图表之间有足够的填充。
渐进光照贴图程序采取了一个短暂的准备步骤来处理几何体与实例的更新,同时生成 G-buffer 和图表遮罩。然后,它会立即生成输出,并随着时间的推移逐步细化输出,以实现更完善的交互式照明工作流。此外,烘焙时间更加可预测,因为渐进光照贴图程序在烘焙时提供估计时间。
渐进光照贴图程序还可单独为每个纹素分别以光照贴图分辨率烘焙全局光照 (GI),无需采用上采样方案或依赖任何辐照度缓存或其他全局数据结构。因此,渐进光照贴图程序具有强大的功能,并允许您烘焙光照贴图的选定部分,从而更快测试和迭代场景。
如需观看介绍交互式工作流程的深入视频,请参阅 Unity 的视频演练:开发中 - 渐进光照贴图 (In Development - Progressive Lightmapper) (YouTube)。
可以在渐进光照贴图程序的两个后端之间进行选择。渐进 CPU 光照贴图程序后端是使用计算机 CPU 和系统 RAM 的渐进光照贴图程序的后端。渐进 GPU 光照贴图程序是使用计算机 GPU 和 VRAM 的渐进光照贴图程序的后端。
For information on the Progressive GPU Lightmapper backend, see the Progressive GPU Lightmapper.
See render pipeline feature comparison for more information about support for the Progressive Lightmapper across render pipelines.
The Apple silicon version of the Unity Editor is not compatible with the CPU Progressive Lightmapper. However, it is compatible with the Progressive GPU Lightmapper.
使用渐进光照贴图程序:
可以使用 LightmapEditorSettings 和 Lightmapping API,通过脚本执行此窗口中提供的许多函数。
This page lists settings specific to the Progressive Lightmapper. For all other lighting settings, see Lighting Settings Asset.
设置 | 描述 | |
---|---|---|
Lightmapper | Use this to specify which internal lighting calculation software to use to calculate lightmaps in the Scene. The options are: The default value is Progressive CPU. |
|
Progressive Updates | 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. This property is visible only when Auto Generate is enabled. | |
Importance Sampling | 启用此设置可将多重重要性采样方法用于对环境采样。通常,这会在生成光照贴图时加快收敛速度,但在某些低频环境中会产生噪声较大的结果。默认处于禁用状态。 | |
Direct Samples | The number of samples (paths) shot from each texel. This setting controls the number of samples that the Progressive Lightmapper uses for direct lighting calculations. Move the slider to improve the quality of direct lighting in lightmaps and Light Probes, at the cost of longer bake times. You can only set the slider to powers of 2. The default maximum value is 1024, but you can change the maximum by typing a new value into the field next to the slider, up to a limit of 230 | |
Indirect Samples | The number of samples (paths) shot from each texel. This setting controls the number of samples that the Progressive Lightmapper uses for indirect lighting calculations. For some Scenes, especially outdoor Scenes, 128 samples should be enough. For indoor Scenes with emissive geometry, increase the value until you see the amount of noise is acceptable. Move the slider to improve the quality of indirect lighting in lightmaps, at the cost of longer bake times. You can only set the slider to powers of 2. The default maximum value is 8192, but you can change the maximum by typing a new value into the field next to the slider, up to a limit of 230 | |
Environment Samples | The Environment Samples property determines the total number of environment rays that Unity fires toward the skybox to gather light directly. Unity fires these rays from the lightmap texel or light probe position depending on the context. The default value is 256. Higher values might yield smoother results, but at the cost of increased bake times. You can only set the slider to powers of 2, with a minimum of 1 and a maximum of 2048. In Scenes with HDR skyboxes, more samples are often needed to reduce noise in the final lightmap or probe. Scenes with skyboxes that include bright singularities (such as the sun) or high-frequency details with significant contrast (such as backlit clouds) also benefit from a higher number of samples. |
|
Light Probe Sample Multiplier | 控制将多少个样本用于光照探针(作为上述样本值的乘数)。更高值可改善光照探针的质量,但会延长烘焙时间。要启用此功能,请选择 Project Settings > Editor,然后禁用 Use legacy Light Probe sample counts。默认值为 4。 | |
Bounces | 使用此值来指定在追踪路径时要执行的间接反弹次数。对于大多数场景,两次反弹就足够了。对于某些室内场景,可能需要更多次反弹。 | |
Max Bounces | The maximum number of bounces you want the Progressive Lightmapper to include in indirect lighting calculations. Default value: 2. Range: 0 - 100. Values of up to 10 are suitable for most Scenes. Values higher than 10 might lead to significantly longer bake times. Each bounce increases the computational resources needed to bake your scene. Use higher bounce values for indoor Scenes, and lower bounce values for outdoor Scenes and those with many bright surfaces. |
|
Filtering | 配置渐进光照贴图程序将后期处理应用于光照贴图的方式,以便限制噪点。为进行光照贴图的后期处理,光照贴图分为 Direct、Indirect和 Ambient Occlusion 目标,Unity 分别对它们进行后期处理,然后将它们组合为一个光照贴图。 - Direct:从光源直接到达传感器(通常是摄像机)的任何光。 - Indirect:从光源间接到达传感器的任何光。这最常应用于反射其他游戏对象的光。 - Ambient Occlusion:光照系统计算的任何环境光。 |
|
无 | 选择此设置表示不对光照贴图应用过滤和进行去噪。 | |
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 falls back to OpenImageDenoise. |
|
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. |
Set Filtering to Advanced to manually configure options for each type of lightmap target. The target types are:
设置 | 描述 |
---|---|
Denoiser | Select a denoiser to use for the lightmap target. The options are: Optix: The NVIDIA Optix denoiser is an AI accelerated denoiser that reduces noise in baked lightmaps. It requires an NVIDIA GeForce, Quadro, or Tesla GPU with Maxwell or newer generation architecture, using driver version R495.89 or above. Optix is only supported on Windows. RadeonPro: The RadeonPro denoiser is an AI accelerated denoiser that reduces noise in baked lightmaps. It requires an OpenCL capable GPU with 4GB+ VRAM. - OpenImageDenoise: The Intel Open Image denoiser is an AI accelerated denoiser that reduces noise in baked lightmaps. - None: Do not use a denoiser. |
Filter | 选择要用于光照贴图目标的过滤器: - Gaussian:选择此选项可将 Gaussian 过滤器用于光照贴图目标。Gaussian 过滤器将双向 Gaussian 过滤器应用于光照贴图。这会使光照贴图模糊并减少可见噪点。 - A-Trous:选择此选项可将 A-Trous 过滤器用于光照贴图目标。A-Trous 过滤器可以将模糊程度降至最低,同时可以消除光照贴图中的可见噪点。 - None:选择此选项可禁用对光照贴图目标的所有过滤。 |
Radius | 仅当 Filter 设置为 Gaussian 时,此选项才可用。使用 Radius 值可设置 Gaussian 过滤器内核的半径(以纹素为单位)。较高的 Radius 值可以提高模糊强度并减少可察觉的噪点,但可能导致光照中的细节丢失。 |
Sigma | 仅当 Filter 设置为 A-Trous 时,此选项才可用。使用 Sigma 值可调整保留细节或使光照模糊的程度。较高的 Sigma 值可以提高模糊强度并减少可察觉的噪点,但可能导致光照中的细节丢失。 |
Auto Generate 和 Generate Lighting 选项下方的面板将显示有关光照贴图的统计信息,包括:
Unity 烘焙光照贴图时出现的进度条提供了“预计到达时间”(显示为 __ETA__)。这是完成当前烘焙的估计时间(秒)。这样可以实现更加可预测的烘焙时间,并可让您快速了解当前光照设置所需的烘焙时间。
Unity automatically generates an ambient probe and a default Reflection Probe to ensure that environment lighting affects your scene and the GameObjects in it by default.
To disable the environment contribution in the lighting result for a scene or GameObject that does not have manually created light maps and Light Probes, disable the default Reflection Probe and the ambient probe. For more information, see Disabling the SkyManager.