Working in scenes that contain several highly-detailed 3D models with high mesh densities can lead to lags in performance. To counter this, you can use the Nanite system in Twinmotion. Nanite is Unreal Engine's virtualized geometry system and is designed to optimize and maintain smooth performance when you work in scenes that contain several complex 3D models that have multiple parts and high triangle counts, such as high-quality photogrammetry scans.
3D models are composed of several triangular polygons, known as triangles. Nanite reduces the memory usage and disk space of 3D models by dynamically optimizing their triangle count in real time based on the amount of screen space objects take up in the scene.
When an object is far away from the viewport camera and takes up less space on screen, Nanite dynamically decreases the triangle count of the object. This simplifies the complexity of the object and only visible details are loaded and rendered.
When an object is nearer to the viewport camera and takes up more space on screen, Nanite increases the triangle count of the object and more object details become visible.
We recommend using Nanite on highly-detailed objects with very dense meshes. An object is an ideal candidate for Nanite if it:
Contains a large number of triangles, or has triangles that will appear very small on screen.
Has a large number of instances in the scene.
Is a major occluder of other Nanite geometry in the scene.
Casts shadows using the Accurate shadow mapping option.
The shadow mapping option is defined in the Ambience panel under Render > Shadows.
Using Nanite is effective when it results in higher frame rates. You can monitor the frame rates and view other performance data by using the Statistics panel.
Benefits of Nanite
Work in real time with larger amounts of extremely complex geometries with higher triangle counts than was possible before.
Graphics Processing Unit (GPU) frame rendering is no longer constrained by 3D model polygon counts, draw calls to the graphics card, and mesh memory usage.
Import film-quality source arts, such as ZBrush sculpts and photogrammetry scans.
Use high poly count detailing instead of texture baking details into normal map textures.
Level of detail (LOD) is managed automatically and does not require manual setup for individual meshes.
Rare or non-existent loss of quality, leading to smooth LOD transitions.
Nanite Support
You can enable Nanite on the following types of assets:
All static supported geometry you import into Twinmotion via the Geometry tab or the Datasmith Direct Link workflow.
Any static 3D model you download from the Sketchfab Library in Twinmotion and add to the scene.
Quixel Megascans Library assets in the 3D assets and 3D plants categories.
Nanite is not supported on the following types of assets:
Twinmotion and Quixel Megascans assets in the Library.
Imported animated files and animated files from the Sketchfab library.
Quixel Megascans Library assets in the Surfaces and Decals categories
Enabling Nanite
Nanite can be enabled:
In the import options when you import geometry into Twinmotion.
On objects in the scene, using the Scene graph or the Properties panel.
Enabling Nanite on Import
To enable Nanite when you import geometry into Twinmotion, do as follows:
Import the geometry into Twinmotion using the Importing Geometry workflow or the Datasmith Direct Link workflow.
When you get to the Import window, do the following:
Make sure the Keep hierarchy collapse mode is selected.
Select the Enable Nanite checkbox.
Click Import.
When you enable Nanite on import, the Nanite settings defined in the Twinmotion Preferences panel determine how Nanite is enabled on the geometry. Once your content is imported, you can override these settings. For more information, see Nanite Settings below.
Enabling Nanite on Objects in the Scene
If Nanite is not enabled on an object in the scene, you can enable it from the Properties panel or the Scene graph menu.
Properties panel: Use this method if you want to enable Nanite on only one object, or on a few items inside a Scene graph container.
Scene graph menu: Use this method if the geometry is divided into several parts inside one or more containers inside the Scene graph. Nanite will be enabled on all the parts inside the parent container and all the parts inside any child containers.
To enable Nanite from the Properties panel, do as follows:
Select the geometry in the viewport or the Scene graph.
In the Scene graph, if the geometry is divided into several parts inside one or more containers, select only the parts inside the containers. Nanite cannot be enabled if a container is selected.
In the Properties panel, click Nanite to expand the section.
(Optional) Modify the Nanite settings. For more information about the settings, see the Nanite Settings section below.
Select the Enable checkbox and click the Apply button.
To enable Nanite from the Scene graph, do as follows:
In the Scene graph, select the parent container.
In the menu, right-click the container and select Convert all to Nanite.
Nanite is enabled on all the parts inside the parent container and any child containers.
Nanite Triangles Viewport Mode
Twinmotion has a variety of visualization modes you can use to inspect different aspects of the scene. Among these is a Nanite triangles view mode you can use to view and inspect the triangles on Nanite geometry.
In the Nanite triangles view mode you can view the triangles on all the geometries in the scene at once. This can be an effective way to verify whether or not Nanite is enabled.
To access the Nanite triangles view mode click the View mode icon (located in the top right-hand corner of the viewport) and in the menu select Nanite triangles.
Nanite Settings
The following table describes the settings for the Nanite system. You can view the settings in the Properties panel by selecting the geometry in the viewport or the Scene graph.
| Setting | Description |
|---|---|
Enable | If selected, Nanite is enabled on selected objects in the scene. |
Auto | If selected, the appropriate precision used to generate vertex positions on geometry is automatically calculated based on the size of the geometry. To improve precision or optimize disk footprint, you can override this by deselecting Auto and choosing a value in Precision. By default, Auto is selected. |
Precision | If Auto is deselected, this option defines the precision used to generate vertex positions on geometry. Options: 0.00122 mm to 64 cm By default, 10 mm is selected. |
Preserve area | If selected, any open boundary edges on the triangles of Nanite meshes are expanded. When Nanite is enabled, meshes can lose surface area and have triangles with open boundary edges due to simplification. Enabling this option is especially useful for foliage, such as a collection of trees in a dense forest, as the size of each leaf is increased, preventing the thinning out of canopies in the distance. Geometrical ribbons, such as blades of grass, are thickened. We recommend enabling this option only on foliage meshes. |
Apply | Click the Apply button to apply the changes you make to the settings. |
Modifying the Nanite Settings
When you enable Nanite on import, or by using the Convert all to Nanite command in the Scene graph, the Nanite settings defined in the Twinmotion Preferences panel determine how Nanite is enabled on geometry. Once Nanite is enabled, you can override these settings and apply them to the Nanite geometry.
To modify the Nanite settings, do as follows:
Select the objects in the viewport or the Scene graph.
In the Scene graph, if the geometry is divided into several parts inside one or more containers, select only the parts inside the containers. The Nanite settings are not visible when containers are selected.
In the Properties panel, modify the Nanite settings.
Click the Apply button.
Limitations
Nanite has some limitations. These are subject to change but currently include the following:
Nanite is supported on macOS but only on devices that use M2 or higher chips.
Nanite can only be enabled on static geometry.
Nanite cannot be enabled on:
Animated files.
Twinmotion and Quixel Megascans assets in the Library.
Objects that have translucent materials, such as glass.
For Nanite to be effective, the topology of the geometry must adhere to the following conventions:
Meshes should not have non-manifold edges, holes, or internal faces.
Meshes should not be extremely small or large.
Meshes need to be consistent and evenly distributed.