UDN
Search public documentation
MeshSimplificationTool
Mesh Simplification Tool
Document Summary: User's guide for the Unreal Editor's Mesh Simplification Tool. Document Changelog: Created by Mike Fricker.Overview
The Mesh Simplification Tool allows you to reduce the geometric complexity of static mesh assets on a per-level basis. It can create a simplified copy of a mesh by parametrically reducing the triangle count, and then storing the mesh inside your level's package. It can also replace references to a high resolution mesh for all actors in the level, and help to maintain the simplified meshes over time. In short, a level designer can use this tool to quickly reduce a map's memory footprint and improve render times, with some trade-off in visual quality.How It Works
Typically you have a static mesh asset that's used in several levels. While you're working on one of these levels you might find that your use-case for this mesh doesn't require quite so much geometric detail. Or, maybe your map is just too slow (or using too much memory) and you need to get it faster. The Mesh Simplification tool lets you create a lower-resolution copy of the original mesh, unique to that level. You can tweak the triangle count of the new simplified mesh and view the changes in your level on-the-fly. This new simplified mesh will be stored right inside the level's package file. Also, the tool will take care of updating all of the actors in the map that reference that mesh. Your changes will only affect the map you're working on. You can repeat this process for any static meshes used in the map that you think would benefit. Afterwards you should see a reduction in memory usage, and possibly an improved frame rate, too! Here is a diagram that shows the before and after of this process:
Note: Currently, only plain static meshes are supported. Skeletal meshes and fractured static meshes may be supported in the future.
Using the Mesh Simplification Tool
This tool is really easy to use! The following sections will guide you through the mesh simplification process from start to finish.Summoning the Tool Window
There are a few ways to bring up the Mesh Simplification window:| You can right-click on any static mesh actor in your level and choose Simplify Mesh for Level.... This is the most common way to summon the tool. | You can open the generic browser and navigate to a static mesh, then right-click on it and choose Simplify Mesh for Level.... |
| |
The Mesh Simplification tool is built into the Static Mesh Editor window as a freely dockable tool window. While working with the Mesh Simplification tool, your window layout settings for the Static Mesh Editor will be stored separately, so feel free to rearrange things however you'd like.
Simplifying a Mesh
After opening the tool, you can see that the mesh you selected for simplification is displayed as the High Resolution Mesh near the top of the window. Along with the object name and package, the mesh's triangle and vertex count are shown here. Additionally, the number of actors in your level that reference this mesh are shown. If you want to know exactly which actors are referencing the mesh you can click the Details... button next to the actor count.
You'll want to choose a triangle count for the simplified mesh you're about to generate. Use the Target Triangles slider in the middle of the tool for this. The slider's range is between one and the number of triangles in the high resolution source model, but the effective range is always a bit smaller. This is because of border edges, UV seams, hard edges, etc, which must be preserved while degrading the model's complexity.
Okay, now you're ready to simplify the mesh! Click Create New Simplified Mesh. A message box will let you know what's going on and you'll be prompted to continue. Choose Yes.
Finally you'll be prompted for a name and package for the new simplified mesh. Usually you can just accept the defaults by pressing OK, and the simplification mesh will be created!
Alright! After a second or two of work, the tool well let you know if everything went well:
For very large models, it's possible for the simplification process to take longer than a few seconds. Generally, the lower the triangle count you select, the faster the mesh rebuild process will complete. Afterwards, the Static Mesh Editor will switch to viewing the new simplified mesh, and you can see results on your model's geometry in the viewport window:
Statistics for the new simplified mesh will be displayed at the bottom of the tool window. Note that, for various reasons, the simplified mesh's triangle count usually won't match the target triangle count you specified. The percentage values represent the triangle and vertex counts of the simplified mesh compared to the high res mesh.
Assigning the Simplified Mesh to Actors
You've created a new simplified static mesh in your level's package. However, the actors in your scene are still referencing the original high resolution mesh. Near the bottom of the Mesh Simplification tool window, you'll see a button named Assign Simplified Mesh to Actors. Clicking this will replace references to the high res mesh on all actors in the 'current' level with the newly-created simplified mesh. The button will be disabled if no actors in your scene are referencing the high res mesh yet.
All of the appropriate actors in your level should now be using the simplified version of the mesh. Also, the changes will be reflected immediately in your level viewport windows.
You've done! If you want to learn about making further adjustments to your mesh, read on.
Updating a Simplified Mesh
Now, you can tweak the quality of the simplified model by adjusting the Target Triangles slider and clicking Update Existing Simplified Mesh. The mesh will be updated immediately and you'll see the results in the level viewports.
The simplified mesh will remember the high resolution mesh it was created from. This makes it easy to make changes to your simplified mesh later on. Also, you might want to refresh it after the high resolution mesh has undergone changes. The editor keeps track of relationships between a simplified mesh and it's high res source mesh to make it easier to maintain these assets.
If you right click over a static mesh actor in your level that's bound to a mesh that's already been simplified with this tool, you'll see an option called Resimplify Mesh....
Selecting this option will bring you straight into the Mesh Simplification tool where you can easily make changes to your model's triangle count.
Other Features
Map Check
The editor's Map Check feature can detect certain problems with simplified meshes in your level. You can run the Map Check utility at any time using the Tools -> Check Map for Errors command in the editor's main menu.
Currently, the following conditions are checked:
- If the high resolution source mesh has been modified since the simplified mesh was created, a warning will be displayed.
- If the editor cannot find the high resolution source mesh associated with a simplified mesh, a warning will be displayed.
Restoring Actor References
If you want to stop using the simplified mesh in your level, you can easily restore references to static mesh actors in your scene to point to the high resolution mesh. This is accomplished using the Restore High Res Mesh to Actors button near the top of the tool window:
All static mesh actors in the current level that were referencing the simplified mesh should now be using the original high res source mesh. The changes will take effect immediately in the level viewports.
Propagating Mesh Changes
If an artist makes a significant change to the high res source mesh after you've created simplified copies of the mesh into various level packages, you'll probably want to update those simplified meshes.- To do this, load up a level that contains a simplified mesh that was spawned from the modified high res source mesh.
- Locate an actor using that mesh in a viewport and right-click on it.
- Select Resimplify Mesh...
- You may be presented with a warning message about the high res mesh appearing to have changed since the last time the simplified mesh was updated. If so, just click OK to dismiss that. We'll repair it right now!
- Select a triangle count for the simplified mesh. The current setting will match the existing simplified mesh's triangle count, which is probably sufficient.
- Click Update Existing Simplified Mesh. This will rebuild the simplified mesh using the new source data in the high res mesh.
- Make sure you're happy with how the simplified mesh looks -- make any appropriate adjustments to the triangle count and update as necessary.
- You'll need to repeat these steps for each affected high res model, and for each level that an affected simplified mesh copy exists in.
Renaming or Deleting Source Meshes
If a high resolution mesh is renamed after a simplified copy has been created, the engine's object redirector system will handle this in the short term. The next time that the FixUpRedirects tool is run, the simplified mesh's soft reference to the high res mesh should be updated automatically. If the high resolution mesh is deleted entirely, then you can expect to receive a warning about this, both in the Map Check window and also when summoning the Mesh Simplification tool for the associated simplified mesh. Currently, there are only a few ways to repair this warning:- Option 1: Open the Mesh Simplification tool for the simplified mesh that's associated with the deleted high res mesh. You'll be prompted with a warning about this, and then you'll be asked if you want to Unbind from the high res mesh entirely. If you choose Yes, the simplified mesh will become a stand-alone mesh in the level's package and the Mesh Simplification tool features will no longer be available.
- Option 2: Create a new high res mesh that's named the same as the deleted mesh and make sure to place it in the same package that the deleted mesh was in. This will eliminate the warning. Now, open the Mesh Simplification tool for the simplified mesh and use Update Existing Simplified Mesh to refresh the visuals.
