Version: 2021.2
Lightmapping
The Progressive GPU Lightmapper (preview)

The Progressive Lightmapper

The Progressive Lightmapper is a fast path-tracing-based lightmapper system that provides baked lightmapsA pre-rendered texture that contains the effects of light sources on static objects in the scene. Lightmaps are overlaid on top of scene geometry to create the effect of lighting. More info
See in Glossary
and Light ProbesLight probes store information about how light passes through space in your scene. A collection of light probes arranged within a given space can improve lighting on moving objects and static LOD scenery within that space. More info
See in Glossary
with progressive updates in the Editor. It requires non-overlapping UVs with small area and angle errors, and sufficient padding between the charts.

The Progressive Lightmapper takes a short preparation step to process geometry and instance updates, and generates the G-buffer and chart masks. It then produces the output immediately and progressively refines it over time for a much-improved interactive lighting workflow. Additionally, baking times are much more predictable because the Progressive Lightmapper provides an estimated time while it bakes.

The Progressive Lightmapper also bakes global illuminationA group of techniques that model both direct and indirect lighting to provide realistic lighting results.
See in Glossary
(GI) at the lightmap resolution for each texel individually, without upsampling schemes or relying on any irradiance caches or other global data structures. This makes it robust and allows you to bake selected portions of lightmaps, which makes it faster for you to test and iterate on your SceneA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary
.

For an in-depth video showing the interactive workflow, see Unity’s video walkthrough: In Development - Progressive Lightmapper (YouTube).

The Progressive CPU Lightmapper and the Progressive GPU Lightmapper (preview)

You can choose between two backends for the Progressive Lightmapper. The Progressive CPU Lightmapper backend is a backend for the Progressive Lightmapper that uses your computer’s CPU and system RAM. The Progressive GPU Lightmapper is a backend for the Progressive Lightmapper that uses your computer’s GPU and VRAM.

Note that the Progressive GPU Lightmapper is a preview feature in active development, and is subject to change. For information on the Progressive GPU Lightmapper backend, see the Progressive GPU Lightmapper (preview).

Render pipeline support

See render pipeline feature comparison for more information about support for the Progressive Lightmapper across render pipelinesA series of operations that take the contents of a Scene, and displays them on a screen. Unity lets you choose from pre-built render pipelines, or write your own. More info
See in Glossary
.

Using the Progressive Lightmapper

To use the Progressive Lightmapper:

  1. Go to Window > Rendering > Lighting
  2. Navigate to Lightmapping Settings
  3. Set LightmapperA tool in Unity that bakes lightmaps according to the arrangement of lights and geometry in your scene. More info
    See in Glossary
    to Progressive CPU or Progressive GPU

You can perform many of the functions available in this window via scriptsA piece of code that allows you to create your own Components, trigger game events, modify Component properties over time and respond to user input in any way you like. More info
See in Glossary
, using the LightmapEditorSettings and Lightmapping APIs.

Settings

This page lists settings specific to the Progressive Lightmapper. See Lightmapping using Enlighten for settings specific to Enlighten Baked Global Illumination (deprecated, unlike Enlighten Realtime Global Illumination). For all other lighting settings, see Lighting Settings Asset.

Setting Description
Lightmapper Use this to specify which internal lighting calculation software to use to calculate lightmaps in the Scene. The options are:

Progressive CPU
Progressive GPU
Enlighten

The default value is Progressive CPU, because Enlighten Baked Global Illumination is deprecated (unlike Enlighten Realtime Global Illumination).
Prioritize View Enable this to make the Progressive Lightmapper apply changes to the texels that are currently visible in the Scene ViewAn interactive view into the world you are creating. You use the Scene View to select and position scenery, characters, cameras, lights, and all other types of Game Object. More info
See in Glossary
, 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 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 500. Higher values might yield smoother results, but at the cost of increased bake times.

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 Controls how many samples are used for Light Probes as a multiplier of the sample values above. Higher values improve the quality of Light Probes, but they will take longer to bake. To enable this feature, go to Project Settings > Editor and disable Use legacy Light Probe sample counts. The default value is 4.
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.
Min Bounces The minimum number of bounces you are willing for the Progressive Lightmapper to include in indirect lighting calculations.

Lower values reduce bake times, but might increase lightmap noise. To improve performance during bakes, the Lightmapper terminates light paths that contribute little to the appearance of the Scene using a technique called Russian Roulette.

Default value: 2. Range: 0–100
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.

As the range between Min Bounces and Max Bounces broadens, the amount of noise visible in your lightmaps increases.
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.
None 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 OcclusionA method to approximate how much ambient light (light not coming from a specific direction) can hit a point on a surface.
See in Glossary
. For more information, see Advanced Filtering settings, below.

Advanced Filtering settings

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 GameObjectsThe fundamental object in Unity scenes, which can represent characters, props, scenery, cameras, waypoints, and more. A GameObject’s functionality is defined by the Components attached to it. More info
    See in Glossary
    .
  • Ambient Occlusion: Any ambient lightLight that doesn’t come from any specific direction, and contributes equal light in all directions to the Scene. More info
    See in Glossary
    that the lighting system calculates.
Setting Description
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 GPU with 4GB+ VRAM and driver version 390+, and is only supported on the Windows platform.
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 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.

Statistics

The panel below the Auto Generate and Generate Lighting options shows statistics about the lightmapping, including:

  • The number of lightmaps that Unity has created
  • Memory Usage: The amount of memory required for the current lightmapping.
  • Occupied Texels: The number of texels that are occupied in lightmap UV space.
  • Lightmaps in view: The number of lightmaps in the Scene view.
  • Lightmaps not in view: The number of lightmaps that are out of view.
    • Converged: All calculations for these lightmaps are complete.
    • Not Converged: Baking is still in progress for these lightmaps.
  • Bake Performance: The number of rays per second. If this is low (that is, less than 2) you should adjust your settings or your hardware to process more light rays at a time.

During baking

Progressive Lightmapper provides options to monitor and stop the bake while it is in progress, if you need to.

ETA

The progress bar that appears while Unity is baking the lightmap provides an “estimated time of arrival” (displayed as ETA). This is the estimated time in seconds for the current bake to complete. This allows for much more predictable baking times, and allows you to quickly learn how much time baking takes with your current lighting settings.

Force Stop

During manual baking, click Force Stop at any time to halt the baking process. This allows you to stop the process as soon as you see results that look good.

Disabling the default environment contribution

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 ProbeA rendering component that captures a spherical view of its surroundings in all directions, rather like a camera. The captured image is then stored as a Cubemap that can be used by objects with reflective materials. More info
See in Glossary
and the ambient probe. For more information, see Disabling the SkyManager.

Lightmapping
The Progressive GPU Lightmapper (preview)
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961