Version: 2023.1
言語: 日本語
ライトマッピング - はじめに
指向性モード 

Lightmap Parameters アセット

Lightmap Parameters (ライトマップパラメーター) アセットには、Unity のライティング機能を制御する一群のパラメーターの値のが含まれています。これらのアセットを使用すると、さまざまな状況で使用するために、ライティングの値のさまざまなセットを定義して保存できます。

ライトマップパラメーターアセットを利用すると、 さまざまなタイプのゲームオブジェクトや、異なるプラットフォームやシーン (例えば、屋内、または、屋外シーンなど) に応じて最適化されたプリセットを素早く作成できます。

ライトマップパラメーターアセットの作成

新しいライトマップパラメーターアセットを作成するには、Project ウィンドウ内で右クリックし、Create > New Parameters Asset を選択します。Unity は Project フォルダーにこれを保存します。

プロパティ

Project ウィンドウでライトマップパラメーターアセットをクリックすると、Inspector ウィンドウにそのアセットで定義した値が表示されます。パラメーターとその説明は下の表のとおりです。

Realtime GI

These parameters configure Enlighten Realtime Global Illumination.

See render pipeline feature comparison for more information about support for Enlighten Realtime Global Illumination across render pipelines.

プロパティ 機能
Resolution この値は、Lighting ウィンドウの Scene タブ (Window > Rendering > Lighting > Scene) の Realtime Resolution の値をスケールし、ライトマップの最終的な解像度 (テクセル/単位距離) を示します。
Cluster Resolution 最終的なライトマップの解像度に対するクラスターの解像度 (ライトのバウンスが内部で計算されている解像度) の比。詳しくは、シーンビューの GI 視覚化 を参照してください。
Irradiance Budget この値は、ライトマップの各テクセルを照らすために使用される入射光のデータの精度を決定します。各テクセルのライティングは、テクセルの位置からシーンの “ビュー” をサンプリングすることによって得られます。放射照度の量が低い場合は、よりぼやけたサンプルになります。値を高くすると、サンプルはよりはっきりします。放射照度の量を上げると、ライティングは改善されますが、ランタイムのメモリ使用量が増加し、CPU の使用が増加する場合があります。
Irradiance Quality スライダーを使って、レイの数を定義します。そのレイはキャストし、指定した出力ライトマップのテクセルに影響するクラスターを計算するために使われます。値を大きくすると、ライトマップの見た目が向上しますが、Unity エディターの事前の計算時間が増加します。この値は、ランタイムのパフォーマンスには影響しません。
Modelling Tolerance この値は、ライトが通り抜けるメッシュジオメトリのすき間の最小サイズを制御します。環境内でライトがより小さなすき間を通り抜けるようにするには、この値を低くします。
Edge Stitching これを有効にすると、不要な視覚的アーティファクトを避けるために、ライトマップの UV チャートを継ぎ目なく結合します。
Is Transparent これを有効にすると、グローバルイルミネーションを計算している間、このオブジェクトは透明になります。後ろを向いたサーフェスはこの計算に何も影響を与えず、ライトはサーフェスを通過します。この設定は非可視の発光性のサーフェスを作成する際に役立ちます。
System Tag ライトマップテクスチャを同じライトマップアトラスにまとめた複数オブジェクトのグループを “システム” と呼んでいます。すべてのオブジェクトが 1 つのアトラスに適合しない場合、Unity は追加のシステムとそれに付随するアトラスを自動的に定義します。ただし、別のシステムを独自に定義する方が便利な場合があります (例えば、別々のルーム内のオブジェクトを、各ルームにつき 1 つのシステムにグループ分けする、など)。 System Tag 番号を変えると、強制的に新しいシステムとライトマップが作成されます。タグの値の数的順序はあまり関係ありません。

Baked GI

これらのパラメーターは ライトマッピング を設定します。

See render pipeline feature comparison for more information about support for lightmapping across render pipelines.

プロパティ 機能
Anti-aliasing Samples Determines the number of sub-texel positions to use when sampling a lightmap texel. Set the value above 1 to use supersampling to improve lightmap quality and reduce artifacts related to aliasing.
•A value of 1 disables super sampling.
•A value of 4 provides 2x2 supersampling. This is the default value which removes most aliasing artifacts.
•A value of 16 provides 4x4 supersampling. Use these values to remove artifacts, like jagged edges in direct lighting. This can happen when you use baked shadows.

Note: A higher anti-aliasing sample value uses more memory. This means that if you use a high sample number in a large Scene with large lightmap texture sizes, the lightmap bake might not complete.
Backface Tolerance Specifies the percentage of front-facing geometry sampling ray hits a texel must have for Unity to consider it valid. This makes it possible for Unity to invalidate a texel if too many of the rays cast from it hit backfaces (e.g. if the texel is inside geometry). A value of 1.0 means that Unity considers a texel invalid when any of its rays hits a backface, for example. When a texel is invalid, Unity clones valid values from surrounding texels to prevent artifacts. Lower this value to solve lighting problems caused by backface samples. Use the Texel Validity Scene View Draw Mode to adjust this value.
Pushoff Pushes ray origins away from geometry along the normal based on the value you specify in modelling units. Unity applies this value to all baked lightmaps. It affects direct light, indirect light, and baked ambient occlusion. Adjust this setting to reduce self-occlusion and self-shadowing artifacts.
Baked Tag Groups specific sets of objects in atlases. As with the System Tag, the exact numeric value is not significant. Unity never puts GameObjects with different Baked Tag values in the same atlas. However, there is no guarantee that objects with the same tag end up in the same atlas because there may be too many objects with that tag to fit into one atlas. See image A (below) for an example of this. You do not need to set this value when you use the multi-scene bake API because Unity groups automatically in that case. You can use Baked Tag to replicate some of the behavior of the Lock Atlas option. See Baked Tags: Details for more information.
Limit Lightmap Count Applies a limit to the number of lightmaps that Unity can use to pack together GameObjects with the same Baked Global Illumination settings. When you enable this limit, a related setting appears called Max Lightmaps. That setting determines the lightmap limit. The Lightmapping Settings define the size of these lightmaps.

Unity considers GameObjects to have the same Baked Global Illumination settings if they have equal values for Anti-aliasing Samples, Pushoff, Baked Tag, and Backface Tolerance. This means that Unity might pack together GameObjects associated with different Lightmap Parameter Assets.

To pack GameObjects into a set number of lightmaps, Unity scales down UV layouts until all fit within the specified number of lightmaps. This process may reduce lightmap resolution.

Baked Tags: 詳細

The two images above shows two views of the same Scene:

  1. Top: Everything is in one atlas because all the GameObjects have the same Baked Tag.

  2. Bottom: One GameObject is assigned a different Baked Tag, and forced into a second lightmap.

Baked AO

これらのパラメーターはベイクしたアンビエントオクルージョンを設定します。

プロパティ 機能
Quality アンビエントオクルージョンを評価するときに発するレイの数。この数字が大きいほどベイクしたアンビエントオクルージョンの品質が向上しますが、ベイク時間も長くなります。
Anti-aliasing Samples アンビエントオクルージョンのアンチエイリアスを行うときに取得するサンプル数。サンプル数が多いほどアンビエントオクルージョンの品質が上がりますが、ベイク時間も長くかかります。

General GI

プロパティ 機能
Backface Tolerance 出力テクセルから発されたレイが表面に当たる割合。システムが有効なテクセルと認識するためには、この割合を満たす必要があります。テクセルから発したレイがあまり多く裏面にあたる場合は (テクセルがジオメトリの内部にある場合)、テクセルを無効にします。テクセルが無効の場合、ライティングシステムは近隣のテクセルから有効な値を複製し、予期しないアーティファクトを避けます。

例えば、Backface Tolerance が 0.0 の場合は、裏面しか見えない場合のみ、テクセルは拒否されます。1.0 の場合は、裏面に当たるレイがたった 1 つあるだけでも、レイを発するテクセルは拒否されます。

ライトマップパラメーターアセットの割り当て

シーン

ライトマップパラメーターアセットをシーン全体に割り当てるには、以下を行います。

  1. Lighting ウィンドウ を開きます (Window > Rendering > Lighting)。
  2. Scene タブを選択します。
  3. Lightmapping Settings に移動します。
  4. Lightmap Parameters ドロップダウンを使用して、デフォルトのライトマップパラメーターアセットを割り当てます。このドロップダウンには、利用可能なすべてのライトマップパラメーターアセットが表示されます。

ゲームオブジェクト

ライトマップパラメーターアセットをゲームオブジェクトに割り当てるには、ゲームオブジェクトにメッシュレンダラーか Terrain コンポーネントがアタッチされていることを確認します。

To assign a Lightmap Parameters Asset to a Mesh Renderer component:

  1. In the Inspector, go to Mesh Renderer > Lighting
  2. Enable Contribute Global Illumination
  3. In the mesh Renderer component, go to Lightmapping > Lightmap Parameters.
  4. Select an option from the menu. Select Scene Default Parameter to use the same Lightmap Parameters Asset that’s assigned to the whole Scene.

To assign a Lightmap Parameters Asset to a Terrain component:

  1. In the Inspector, go to Terrain > Terrain Settings > Lighting
  2. Enable Contribute Global Illumination
  3. In Terrain Settings, go to Lightmapping > Lightmap Parameters.
  4. Select an option from the menu. Select Scene Default Parameter to use the same Lightmap Parameters Asset that’s assigned to the whole Scene.

2019–03–28 修正されたページ

2018–03–28 修正されたページ

Limit Lightmap Count は 2019.1 で追加NewIn20191

プログレッシブライトマッパーは 2018.1 で追加 NewIn20181

LightmapParameters

ライトマッピング - はじめに
指向性モード