各ライトマップには多くの チャート が含まれています。実行時に Unity はこれらのチャートをメッシュ面にマッピングし、チャートのライティングデータを使用して最終的な外観を計算します。GPU のサンプリングの仕組みにより、チャートのデータが互いに近すぎる場合、1 つのチャートからのデータが他のチャート上に、にじみを作る可能性があります。これは通常、意図しないエイリアシング、ピクセレーション (ピクセルが大きくなり出力結果が非常に粗くなる状態)、その他のグラフィカルな結果 (アーティファクトと呼ばれます) を引き起こします。
ライトのにじみを避けるためには、チャート間に十分なスペースが必要です。GPU がライトマップをサンプリングすると、ライティングシステムはサンプリングされた点に最も近い 4 つのテクセルから最終的なサンプル値を計算します (バイリニアフィルタリングが使用されていると仮定)。これらの 4 つのテクセルはサンプリングされた点のバイリニアのネイバーと呼ばれます。チャートが近すぎると重なってしまいます、つまり、チャート内の点が、他のチャート内の近隣の点 (ネイバー) と重なります。下の画像では、白のピクセルはチャートのネイバーを示し、赤のピクセルは重なっているネイバーを示しています。
最適なチャートの配置と間隔の決定は、いくつかのパラメーター (ライトマップ解像度、メッシュ UV、インポーター設定など) に依存するため、難しい場合があります。このため、Unity にはこれらの問題を簡単に識別する機能があります。以下のセクションで概要を説明します。
重複を識別するには 3 つの方法があります。
Unity のコンソールに注目してください。Unity が重複する UV を検出すると、警告メッセージと影響を受けるゲームオブジェクトのリストを表示します。
Scene (シーン) ビューで UV Overlap 描画モードを使用します (詳細はシーンビューの GI ビジュアライゼーション を参照)。このモードを有効にすると、他のチャートのテクセルに近すぎるチャートテクセルに赤いハイライトが表示されます。これは、シーンビューでアーティファクトを発見し、UV の重複がアーティファクトの原因かどうかを素早く調べたい場合に特に便利です。
UV の重複を解決する方法は 1 つだけではありません。なぜなら、UV の重複を引き起こす原因は多岐にわたるからです。以下は最も一般的な解決策です。
プログレッシブライトマッパーは 2018.1 で追加 NewIn20181
パックマージンの計算は 2020.1 に追加NewIn20201
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.