UE4 Static Mesh LODs

来源:互联网 发布:mac 口红brave 编辑:程序博客网 时间:2024/05/28 11:30

Static Mesh LODs

Static Meshes can make use of levels of detail (LODs) in-game in order to limit the impact of meshes as they get farther from the camera. Generally, this means each level of detail will have a reduced number of tris and, perhaps, a simpler material (or materials) applied to it.

lods.jpg

The FBX pipeline can be used to export/import these LOD meshes.

LOD Setup

General

In general, LODs are handled by creating models of varying complexity going from the full-detail base mesh to the lowest-detail LOD mesh. These should all be aligned and occupying the same space with the same pivot point. Each LOD mesh can have completely different materials assigned, including different amounts of materials. This means the base mesh could use multiple materials to give the desired amount of detail up close, but the lower-detail meshes could use a single material since details will be less noticeable.

  1. Select all of the meshes (base plus LODs) in order from the base LOD down to the last LOD. This is important so that they are added in the correct order in terms of complexity. Then select the Level of Detail > Group command from the Edit menu.

    maya_lod_group.jpg

  2. You should now have the meshes all grouped under the LOD Group.

    maya_lod_contents.jpg

Export LODs

To export the StaticMesh LODs:

  1. In Maya: select the LOD Group and any collision geometry.

    maya_lod_export_select.jpg

  2. Follow the same export steps used for the base mesh (described above in the Export Mesh section). Make sure to enable export of animations in the FBX exporter properties. This is required for LODs to be exported.

Import LODs

Static Mesh LODs can be imported along with the base mesh in the Content Browser or they can be imported individually through the Static Mesh Editor.

Mesh with LODs

  1. Click the button_new.png button in the Content Browser and choose Import. Navigate to and select the FBX file you want to import in the file browser that opens. Note: you may want to select import_fbxformat.jpg in the dropdown to filter out unwanted files.

    The imported path of the imported asset depends on the current location of the Content Browser while importing. Make sure to navigate to the appropriate folder prior to performing the import. You may also drag the imported assets into a new folder once import is complete.

  2. Choose the appropriate settings in the Import dialog. The defaults should be sufficient, but also make sure that Import LODs is enabled.Note: When importing LODs, the name of the imported mesh will follow the default Naming Rules. See the FBX Import Dialog section for complete details of all of the settings.

    ImportOptions_LOD.png

  3. Click the button_import.png button to import the mesh and LODs. The resulting mesh, material(s), and texture(s) will be displayed in the Content Browser if the process was successful.

    ImportedMeshAndTex.png

    Although textures and materials can be imported with a Static Mesh, only Color and Normal will automatically be connected (assuming a supported material was used in Max/Maya](Engine/Content\FBX\Materials)), Specular maps will be imported but not connected, other maps, like Ambient Occlusion map in the Diffuse slot of a maya material, will not even be imported; it is best to check your materials and connect any unconnected maps and check which maps did not import. Simply double-click the new material and connect the available textures into their appropriate inputs.

    By viewing the imported mesh in the Static Mesh Editor, you can cycle through the LODs using the button_AutoLOD.png dropdown at the far right side of the toolbar.

0 0