ライトマップでは 2 種類の Directional Modes (指向性のモード) が可能です。 Directional (指向性) と Non-Directional (非指向性) があります。ライトマップに 指向性モード を設定するには、Lighting ウィンドウを開いて (Window > Lighting > Settings) Scene をクリックし、 Lightmapping Settings のセクションで Lightmapper が Enlighten になっているのを確認し、 Directional Mode ドロップダウンリストで選択します。どちらのモードもリアルタイムやベイクしたライトマップとして使用できます。
Directional ライトマップは、ライティング環境に関して、Non-Directional のライトマップよりも詳細な情報を格納します。シェーダーでは、入射光に関する詳しいデータを使用し、画面に表示されるマテリアルの見え方を決定する出射光の計算結果を向上させます。これによって、テクスチャメモリの使用量とシェーディング時間の増加し負荷が発生します。
Non-Directional ライトマップは平らな拡散を生成します。このモードはただ 1 つのライトマップを使用しており、光が純粋に拡散すると仮定して、どれだけ多くの光を表面から放出するかという情報を保存しています。オブジェクトはこの方法で照らされると、平らに (法線マップは使用されません) 拡散しているように(マテリアルがスペキュラーであっても) 見えます。しかし、それ以外は正しくライティングされます。これらの樽は、ベイクしたライトマップを使用しています。詳細な定義は、リフレクションプローブとオクルージョンマップのみから来ています。
Directional ライトマップは法線マップによる拡散を生成します。このモードは、第2 のライトマップを持ち、それは入ってくる主な光の方向と、第1 のライトマップのうちどれだけの光がその主要な方向に沿って入ってくるかの比例係数を格納します。つまり、残りの光は半球全体から均等に来ると仮定します。その情報を基にマテリアルは法線マップにされますが、それでも純粋に拡散するように表示されます。
Directional モードでは、Non-directional モードの 2 倍のテクスチャメモリを消費し、少しだけ高いシェーディング負荷がかかります。
Non-directional 1つのテクスチャ、1つのテクスチャサンプル、2–3 の付加的なシェーダー命令。
Directional 2つのテクスチャ、2つのテクスチャサンプル、さらにいくつかの付加的なシェーダー命令。
リアルタイムライトマップは同じアプローチをしています。そして、シェーディングの品質とコストのバランスに関しても同様です。
実際に間接光 (ベイクされたライトの間接的な部分) に使用される BRDF は、わずかにコストを削減できます。UNITY_BRDF_PBS_LIGHTMAP_INDIRECT
は UnityPBSLighting.cginc で定義されています。
ライトマップの静的アセットにスペキュラーライトを適用するには、Lighting Mode を Baked light の Shadowmask か Distance Shadowmask に設定してください。詳しくは、Light Modes を参照してください。
2017–06–08 公開ページ
5.6 で Direct Specular を削除
Light Modes、 5.6に追加
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.