シーン内のゲームオブジェクトがカメラから遠くにあるとき、ゲームオブジェクトがカメラの近くにあるときと比べて、細かい部分を見ることはできません。そして、離れたゲームオブジェクトの詳細を見ることができないとしても、Unity はどちらの距離にあるものも同じ数の三角形を使用してレンダリングします。
レンダリングを最適化するには、Level Of Detail (LOD) 技法を使用します。LOD では、ゲームオブジェクトがカメラから遠ざかるにつれて描画する三角形の数を減らすことができます。いくつかのメッシュと任意の ビルボードアセット を使用します。これらはすべて、同じゲームオブジェクトをジオメトリの詳細さを削減して表現したものです。各メッシュには Mesh Renderer コンポーネントが含まれ、‘メッシュの LOD レベル’ を表します。ビルボードアセットには Billboard Renderer コンポーネントがあり、「ビルボードの LOD レベル」を表します。
ゲームオブジェクトのすべてが同時にカメラの近くにあるわけではない場合、LOD はハードウェアの負荷を軽減し、レンダリングのパフォーマンスを向上させます。
Unity では、LOD Group コンポーネントを使用して、ゲームオブジェクトの LOD レンダリングを設定します。以下の画像は、カメラからの距離に応じて LOD レベルがどのように変化するかを示しています。
図 1 は最初のレベル LOD 0 を示しています。このレベルはカメラに最も近い値であるため、最も詳細な LOD レベルです。例えば、多くの第 1 レベルの LOD は、ゲームオブジェクトの高さが画面の高さの 50% 以上を占める場合にアクティブになります。
図 2 は、次のレベル LOD 1 を示しています。このレベルはカメラから遠いので、LOD レベルが低くなります。例えば、多くの LOD Group は 3 つのレベルを使用します。ゲームオブジェクトが画面の高さの 25% から 49% を占めるとき LOD 1 がアクティブになり、ゲームオブジェクトが画面の高さの 25% 未満を占めるとき LOD 2 がアクティブになります。
LOD レベルの設定は、ターゲットプラットフォームと可能なレンダリングパフォーマンスに依存するため、Unity で最高の LOD レベルと Lod Bias の Quality 設定を設定できます。Lod Bias は、しきい値の距離の場合に、高い/低い、どちらの LOD レベルを優先するかを決定します。
一揃いの LOD メッシュをインポートすると、ゲームオブジェクトの LOD グループが自動的に作成され、以下の命名規則に従うと適切な設定が適用されます。
_LOD
と 0
から「LOD レベルの総数 - 1」の範囲の数字で終わる名前にします。例えば、メッシュの基本となる名が Player の場合、ファイル名を Player_LOD0
、Player_LOD1
、 Player_LOD2
とすると、Player ゲームオブジェクトを 3 つの LOD レベルで生成されます。_LOD0
と名づけます。LOD レベル数に上限はありません。
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.