スカイボックス
シーン上の裏で動いている Unity のレンダリング

LOD(Unity Proのみ)

シーンが大きくなるにつれて,パフォーマンスは大きな問題になります。これを管理するための方法の一つは,カメラが被写体からどれだけ離れているかに応じて,さまざまな詳細レベル(Level of Detail)でメッシュを持つことです。 これはLevel of Detail(略語:LOD)と呼ばれます。

LOD Groups are used to manage level of detail (LOD) for GameObjects. Level of Detail is an optimisation technique that uses several meshes for an object; the meshes represent the same object with decreasing detail in the geometry. The idea is that the low-detail meshes are shown when the object is far from the camera and the difference will not be noticed. Since meshes with simpler geometry are less demanding on the hardware, performance can be improved by using LOD judiciously.

LOD Group inspector
LOD Group inspector

Properties

The different LOD levels are visible in the horizontal bar with the camera icon just above it (LOD: 0, LOD: 1, LOD: 2, etc). The percentages in the LOD bars represent the fraction of the view frustum depth where that LOD level becomes active. You can change the percentage values by dragging the vertical lines that separate the bars. You can also add and remove LOD levels from the bar by right-clicking it and selecting Insert Before or Delete from the contextual menu. The position of the camera icon along the bar shows the current percentage distance of the object within the scene view frustum.

When you click on one of the LOD bars to select it, a Renderers panel will be shown beneath. The “renderers” are actually GameObjects that hold the mesh to represent the LOD level; typically, this will be a child of the object that has the LODGroup component. If you click on an empty box (with the word “Add”) in the Renderers panel, an object browser will appear to let you choose the object for that LOD level. Although you can choose any object for the renderer, you will be asked if you want to parent it to the LODGroup GameObject if it isn’t already a child.

At the bottom of the inspector are two Recalculate buttons. The Bounds button will recalculate the bounding volume of the object after a new LOD level is added. The Lightmap Scale button pdates the Scale in Lightmap property in the lightmaps based on changed LOD level boundaries.

スカイボックス
シーン上の裏で動いている Unity のレンダリング