Version: 2019.4
ライトマッピング
The Progressive GPU Lightmapper (preview)

The Progressive Lightmapper

The Progressive Lightmapper is a fast path-tracing-based lightmapper system that provides baked lightmaps and Light Probes 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 illumination (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 Scene.

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 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

  • The Built-in Render Pipeline supports the Progressive Lightmapper.
  • The Universal Render Pipeline (URP) supports the Progressive Lightmapper.
  • The High Definition Render Pipeline (HDRP) supports the Progressive Lightmapper.

Using the Progressive Lightmapper

To use the the Progressive Lightmapper:

  1. Go to Window > Rendering > Lighting Settings
  2. Navigate to Lightmapping Settings
  3. Set Lightmapper to Progressive CPU or Progressive GPU

You can perform many of the functions available in this window via scripts, using the LightmapEditorSettings and Lightmapping APIs.

Settings

項目 説明
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 (deprecated)

The default value is Progressive CPU.
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.
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.
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 Occlusion. For more information, see Advanced Filtering settings, below.
Indirect Resolution Use this to specify the number of samples the lightmapper uses for indirect lighting calculations. Higher values can improve the quality of the lightmaps, but increase the time it takes to bake them.
Lightmap Resolution Use this to specify the number of texels per unit to use for lightmaps. Increasing this value improves lightmap quality, but also increases bake times. Note that doubling this value causes the number of texels to quadruple (because the value refers to both the height and width of the lightmap). See the Occupied texels count in the statistics area at the bottom of the Lighting window.
Lightmap Padding Use this to specify the separation (in texel units) between separate shapes in the baked lightmap. The default value is 2.
Lightmap Size The size (in pixels) of the full lightmap texture, which incorporates separate regions for the individual GameObject textures. The default value is 1024.
Compress Lightmaps 圧縮ライトマップは、必要な保存スペースが少なく済みます。しかし、圧縮処理によって、テクスチャに不要な視覚的エフェクトが発生する場合があります。このチェックボックスを有効にすると、ライトマップを圧縮します。無効にすると、圧縮しません。デフォルトではチェックボックスは有効になっています。
Ambient Occlusion Tick this checkbox to open a group of settings which allow you to control the relative brightness of surfaces in baked ambient occlusion. Higher values indicate a greater contrast between the occluded and fully lit areas. This only applies to the indirect lighting calculated by the GI system. This setting is enabled by default.
Max Distance Set a value to control how far the lighting system casts rays in order to determine whether or not to apply occlusion to an object. A larger value produces longer rays and contributes more shadows to the lightmap, while a smaller value produces shorter rays that contribute shadows only when objects are very close to one another. A value of 0 casts an infinitely long ray that has no maximum distance. The default value is 1.
Indirect Contribution スライダーを使って、完成したライトマップで表示される間接光 (アンビエントライト、オブジェクトにバウンドしたライト、オブジェクトから放出されたライト) の輝度を 0 から 10 の間で増減します。デフォルト値は 1 です。1 より小さい値にすると強度が下り、 1 より大きくすると強度は上がります。
Direct Contribution スライダーを使って、最終的なライトマップで表示される直接光の輝度を 0 から 10 の間で増減します。デフォルト値は 0 です。この値を大きくすると、直接光に適用されるコントラストが強くなりります。
Directional Mode You can set the lightmap up to store information about the dominant incoming light at each point on the objects’ surfaces. See documentation on Directional Lightmapping for further details. The default mode is Directional.
Directional In Directional mode, Unity generates a second lightmap to store the dominant direction of incoming light. This allows diffuse normal mapped materials to work with the GI. Directional mode requires about twice as much storage space for the additional lightmap data. Directional lightmaps cannot be decoded on SM2.0 hardware or when using GLES2.0. They fall back to Non-Directional lightmaps.
Non-directional Non-directional mode disables Unity’s ability to generate a second lightmap to store the dominant direction of incoming light.
Indirect Intensity スライダーを使って、リアルタイムおよびベイクしたライトマップに保存されている間接光の輝度を 0 から 5 の値で制御します。1を超える値は間接光の強度を増加し、1 未満の値は間接光の強度を減少します。
Albedo Boost Use this slider to control the amount of light Unity bounces between surfaces, from a value between 1 and 10. To do this, Unity intensifies the albedo of materials in the Scene. Increasing this draws the albedo value towards white for indirect light computation. The default value of 1 is physically accurate.
Lightmap Parameters Unity uses a set of general parameters for the lightmapping in addition to properties of the Lighting window. A few defaults are available from the menu for this property but you can also create your own lightmap parameter file using the Create New option. See the Lightmap Parameters page for further details. The default value is Default-Medium.

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.
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.

統計

Auto GenerateGenerate Lighting オプションの下にあるパネルには、以下を含むライトマッピングに関する統計情報が表示されます。

  • Unity が作成したライトマップの数
  • メモリ使用: 現在のライトマッピングに必要なメモリ量。
  • Occupied Texels: ライトマップの UV 空間で占有されるテクセルの数。
  • Lightmaps in view: シーンビューのライトマップの数。
  • Lightmaps Not in view: 非表示のライトマップの数。
    • Converged: すべての計算が完了したライトマップの数。
    • Not Converged : ベイクがまだ進行中のライトマップの数。
  • 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.

ベイク中

プログレッシブライトマッパーは、必要な場合に、進行中のベイクを監視し停止するためのオプションを提供します。

ETA

Unity がライトマップをベイクしている間に表示されるプログレスバーは、「完了までの予定時間」(ETA と表示されます) を提供します。これは、現在のベイクが完了するまでの推定時間 (秒) です。これにより、ベイク時間を予測することがより容易になり、現在のライティング設定でベイクする時間がどれだけかかるかがすぐにわかります。

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.

ライトマッピング
The Progressive GPU Lightmapper (preview)