UDN
Search public documentation
ImportingSkeletalLODs
Importing Skeletal LODs
Document Summary: This document explains how to import a lower LOD (Level Of Detail) version of a skeletal mesh. Document Changelog: Created by Andrew Moise.Overview
Because updating all the bones and vertices of a skeletal mesh can be quite expensive, it is possible to use lower LOD (Level Of Detail) versions of the mesh when the character is seen from a distance. This can be a significant optimization when rendering many characters in a scene. UnrealEngine 3 supports both Mesh and Bone LOD for skeletal meshes. Lower-detail meshes are created by an artist, and then imported as an LOD to use for an existing SkeletalMesh. Once you have added an LOD, you control at what distance that LOD is used in the game. When rendering a lower LOD version of a mesh, the animation system will only animate and update the bones required. UnrealEngine 2 used to have code to automatically generate lower-poly versions of a skeletal mesh, but this functionality was removed as the results were far worse than artist-created LODs.Creating A Low-LOD Mesh
When you import a lower-LOD version of a mesh, it should contain less triangles and less bones than the 'base' high-poly version. There are some requirements you must meet to use a mesh as an LOD for another:- When removing bones, they can only be removed from the ends of the hierarchy. So removing fingers is a good idea for an LOD, but you cannot remove bones from the spine for example.
- The root bone for the base mesh and the LOD should be the same.
- The hierarchy of the base mesh and the LOD must be the same.
Viewing LODs
There are some buttons on the toolbar of the AnimSetViewer that allow you to see how the different LOD levels for a mesh look:
| Auto | Select the LOD level to use automatically, based on the size of the mesh on the screen. This allows you to preview how the mesh will look in-game. |
| B | Force the display to use the `Base' mesh (ie LOD 0). |
| 1 | Force the display to use LOD 1. |
| 2 | Force the display to use LOD 2. This is gray in this case, as there is no LOD 2 imported for this mesh. |
| 3 | Force the display to use LOD 3. There is no LOD 3 imported for this mesh. |
Importing An LOD
First open the AnimSetViewer with the SkeletalMesh that you want to add an LOD to. Then under the `File' menu select `Import Mesh LOD'. You will be asked to specify the PSK file that contains the lower-detail version of that mesh. Once you have selected the .PSK to import, a combo box will pop up allowing you to choose which LOD level to import this mesh as. LOD 0 is the `base', or highest poly mesh. LOD 1 is the first step down and so on. Importing at an LOD that already exists will replace the existing LOD mesh. If your import goes successfully and does not generate any errors, you can press the appropriate `Force LOD' button on the toolbar to see if your mesh came in correctly.Configuring An LOD
There are some settings you will need to adjust for your LOD to work properly. Each LOD level has an entry in the LODInfo array under the `Mesh' tab on the right.
You can ignore entry 0 in this array, as that is the `Base' mesh.
| DisplayFactor | This controls how big the mesh must be on screen before that LOD is used. A smaller number means the LOD will be used when the mesh is further away. You can see the current DisplayFactor for the preview of the mesh at the top of the 3D window. The DisplayFactor for each successive LOD level should be smaller than the last. |
| LODHysteresis | To avoid meshes `flickering' between two LOD levels when right on the boundary between them, this parameter allows you to introduce some `bias' when transitioning from simple to complex versions. |
| LODMaterialMap | LOD versions of a mesh must use the same materials as the base mesh. However, when you import a mesh the materials may be imported in a different order. This array allows you to choose which element of the SkeletalMesh's Materials array maps to each section of the LOD. |