What Options Should I Choose?#
Scene Optimizer provides operations and options you can apply to a scene, alone or combined in a processing stack. Choosing among them is not always easy: it depends on the scene’s components and on which optimizations will improve the intended end-user workflow. This guide explains how to approach those optimizations and why the choices can improve the user experience.
Consider What To Solve#
The first step is to consider what problem you are trying to solve. There can be a number of problems with large complex scenes, for example:
The scene uses too much system memory or GPU memory.
The scene is slow to navigate or to play back animation interactively.
The scene is slow to load.
Improving Memory Usage#
If the scene uses too much memory, look for optimizations that reduce the resources needed by the scene. Specific operations that can help reduce memory are listed below.
Deduplicate Geometry#
Deduplicate Geometry replaces multiple copies of meshes with a single instance prototype plus references to that prototype prim. Since a reference to a copy needs less memory than the full mesh, Deduplicate Geometry can reduce memory usage. It can affect both system memory and GPU memory, since the meshes are stored in both places.
Note
Deduplicate Geometry is only effective if there are meshes that are identical but are not already instances. The operation may have no effect on your scene. To check, look at the report created in the Scene Optimizer UI window to see the output log of the optimization. There are utility operations that can help deinstance applicable prims if new instance prototypes are preferred.
Optimize Materials#
If a scene has a large number of materials, it is possible there could be duplicate materials. Run Optimize Materials to replace duplicate materials with references to unique materials. Deduplicating materials can reduce memory usage and also improve performance.
Convert to Color
Convert to Color is an option on Optimize Materials that replaces materials with color per vertex. If there are a lot of materials in the scene, Convert to Color significantly reduces prim count, speeding up loading and interactivity. Resolving MDLs can be slow so using colors instead can greatly reduce load times, although of course there will be no material shading, only colors.
Improving Interactive Performance#
If the scene has poor interactive usage performance (low FPS), look for optimizations that reduce the number of prims or mesh complexity in the scene. A large number of prims in the scene can affect performance significantly. Specific examples include the following operations:
Merge Static Meshes#
Merge Static Meshes replaces multiple meshes that share common properties with single meshes. Merging reduces scene prim count, and can improve interactive performance. Note that because the total amount of geometry does not change, Merge Static Meshes will not reduce memory consumption. The operation has additional options to define a specific merge boundary to output the resulting merged mesh.
Meshes can be clustered and merged spatially as an option in the process that can improve render performance by creating new bounding boxes set to the defined spatial boundary thresholds. Spatial clustering is also available within the Split Meshes operation to reduce reprocessing with multiple Scene Optimizer operations.
Caution
Once meshes are merged, you can no longer edit individual original meshes, only the new merged mesh prims. Meshes can be split again using Split Meshes Operation.
Decimate Meshes#
Reducing mesh complexity and face count can be an easy way to improve interactive scene performance and reduce memory usage of the input stage. Meshes can be decimated by an overall reduction percentage or a defined tolerance based on the input mesh and guided by normals to retain original mesh features. Decimation can also help reduce overall memory usage.
Find Occluded Meshes#
If there are meshes that exist in the stage, but aren’t visible to the camera due to their world position in the stage, Find Occluded Meshes can be helpful in identifying meshes to deactivate or make invisible to improve load times or FPS.
Optimize Skeleton Roots#
Optimize Skeleton Roots is a good option to try if you have rigged characters that use UsdGeomSkel. It will merge all meshes on the skeleton into a single mesh. As with Merge Static Meshes, Optimize Skeleton Roots will not significantly reduce memory usage.
Note
If a scene has high loading times, reducing the memory the stage consumes can speed up scene evaluation by Kit applications. This can improve the time it takes to load and render a scene in targeted Kit applications.
Improving Load Time#
Load time is made up of two distinct kinds of work, and an optimization that improves one may do nothing for the other:
USD work - layer parsing, composition, payload resolution and stage traversal. This scales with the number of prims in the stage, and also governs how long the stage takes to transfer and to open in any tool that does not involve a renderer.
Render preparation - MDL shader compilation, asset cook, texture upload and acceleration structure builds. This scales with the number of unique materials, textures and unique meshes rather than with prim count.
Establish which of the two dominates before choosing an operation. A stage that is slow to open in a USD tool is usually bound by prim count, and the operations below apply. A stage that opens quickly outside a renderer but is slow to become interactive in a Kit application is usually bound by render preparation, where Optimize Materials and its Convert to Color option are the more effective levers.
Deduplicate Geometry With Point Instancers#
The Point Instancer method of De-duplicate Geometry replaces each set of duplicate meshes with a single UsdGeomPointInstancer. The geometry is authored once as a prototype and every duplicate becomes an instance entry on that instancer.
This is the most effective operation available for reducing prim count on highly repetitive content, such as CAD-converted factory, building, and plant data where the same bolt, beam, fixture, or fitting has been authored thousands of times as unique geometry.
It reduces load time in three ways:
Every duplicate that becomes an instance entry is one fewer prim to compose, traverse, and resolve. On repetitive stages this frequently removes most of the prims in the scene.
The renderer builds its acceleration structures from the prototype rather than from each copy, which lowers GPU memory and shortens the time spent preparing the scene for ray tracing.
Less geometry is written to disk, so the stage is faster to transfer and to open from a network location.
Note
How much this helps depends heavily on how repetitive the source data is. Measure your own scene before and after rather than assuming a result.
Order Of Operations#
Deduplication targeting point instancers needs preparation to ensure correct data conformity. Run these in order:
Deinstance existing instances. Utility Functions with the Deinstance function clears
instanceableon prims that already have it set. De-duplicate Geometry cannot look inside a native instance, so geometry behind an existing instance boundary is skipped. Source data sometimes contains instance boundaries that share almost nothing while still blocking deduplication.Run Optimize Materials. A PointInstancer prototype is material-homogeneous, so meshes that are geometrically identical but carry their own separate material prims cannot share a prototype. Some conversion pipelines author one material prim per mesh, which splits every duplicate set down to a single member and leaves nothing for deduplication to do (aside from rebinding materials manually).
Run De-duplicate Geometry with Method set to Point Instancer.
Run Prune Leaves. Deduplication empties the hierarchy that used to hold the individual copies, and pruning removes the leftover structure.
Settings That Determine Whether Duplicates Are Found#
Two arguments decide whether the operation reports many duplicate sets or none at all. If a scene that visibly contains repeated parts yields no duplicate sets, check these before concluding the content cannot be optimized:
Consider Deep Transforms, which is enabled by default, allows two meshes to match when their stored point values differ by a linear transform, instead of requiring the point arrays to agree directly. It is intended to find more duplicates rather than fewer. In practice some data sets report substantially more duplicate sets with it disabled, so if a scene returns few or no duplicates it is worth running it both ways and comparing the counts before concluding the content cannot be deduplicated.
Ignore Attributes excludes named attributes from the comparison. Conversion pipelines often stamp a unique per-element identifier on every prim, and a single differing value of this kind is enough to make otherwise identical meshes compare as distinct. Naming that attribute in Ignore Attributes restores the matching.
Caution
When using Ignore Attributes, prefer naming the specific attribute over ignoring an entire namespace. A namespace ending in : also excludes every other attribute beneath it, which can merge geometry across categories you intended to keep separate, such as source layer or level provenance.
Minimum Duplicates controls how many copies a set must contain before an instancer is created for it. Raising it avoids creating instancers for very small sets.
Trade-offs#
Caution
Instances within a PointInstancer are not individually selectable in the UI. The instancer is a single selectable object, so this approach is appropriate for loading, viewing, and inspection workflows, but not where users need to select, manipulate, or attach data to individual parts. Confirm this is acceptable before applying it to production data.
This method may also be unsuitable for scenes intended for physics or SimReady workflows, which generally expect individually addressable prims. Test on a copy of the data and confirm the result meets your runtime requirements before applying it to live production content.
Per-prim attributes that carried meaning on the original copies, such as source identifiers, are not preserved per instance by default. If downstream tooling depends on them, plan how to carry that data onto the instancer before adopting this approach.
Confirming The Result#
Check that the number of meshes the renderer actually draws is unchanged: open the Statistics window (Window > Utilities > Statistics) before and after, and compare the rendered mesh and triangle counts. Those should stay the same while prim count falls. The Report tab in the Scene Optimizer UI reports how many duplicate sets were found and instanced.
Note
Asset Validator is a useful first step on data of this kind. Content produced by CAD conversion frequently contains empty meshes, zero-extent prims and broken references that inflate prim count without contributing geometry, and removing those improves load time independently of instancing.
Other Tools#
These operations do not directly affect scene performance, but may affect usability and workflows:
Compute Pivot#
This will place the parent transform at the center of the bounding box of the mesh or xform. This makes it easier to interact with objects in the scene because the transform manipulator is centered on the object. Some tools generate scenes where the transform is at the origin, meaning it is far from the actual vertices, making it hard to move a mesh precisely.
Compute Extents#
Extents are the axis aligned bounding boxes of the meshes. These do not always exist in a USD file. The extents can be used to improve scene performance since they allow the application to know the exact bounds of an object. Running Compute Extents on an imported scene can improve performance.
Advanced Functionality#
Python Script#
This operation will execute python code with access to the USD Stage. Users can add custom logic to the their data, create optimization stacks specific to their needs, and make them available for others via JSON config files. This allows users to work with scene optimizer processes without needing to run code on the stage via the script editor first.
Split Meshes#
Splitting meshes can be helpful in debugging and finding spatial outliers in the stage. Using Spatial Clustering Mode, meshes will be split and merged spatially by user-specified values. This also greatly improves processing performance when running in this mode to split and merge meshes in a single process versus running each operation separately. This approach can help with render performance by creating smaller bounding volumes than previously were present prior to optimization. Spatial Clustering Mode is also available in Merge Static Meshes.
Mesh Cleanup#
Poorly constructed meshes can slow rendering. Mesh Cleanup can merge vertices and make meshes manifold, which can improve render performance.
Note
Asset Validator can help identify incompatible meshes with the available rule checks.
Remesh Meshes#
If a problematic mesh exists in the stage, using the Remesh Meshes operation will generate a new topology for any specified input mesh prim. This can be helpful if a mesh is not rendering or performing as intended from the original source tools. This operation used with decimation can be an effective way to clean and optimize any geometry to improve overall performance.
Summary of Expected Performance Improvements#
Optimization |
Performance Benefit |
||||
Process |
Options |
Load Time |
CPU RAM |
GPU RAM |
FPS |
Merge Meshes |
By Selection |
Slight |
N |
N |
Y |
Merge Meshes |
By Material |
Slight |
N |
N |
Y |
Merge Meshes |
Rigid Body |
Slight |
N |
N |
Y |
Merge Meshes |
By Skeleton |
Slight |
N |
N |
Y |
Merge Meshes |
By Spatial Clustering |
Y |
N |
N |
Y |
Decimate Meshes |
Tolerance/ Reduction Percentage |
Y |
Y |
Y |
Y |
Deduplicate Geometry |
Instances |
Y |
Y |
N |
Slight |
Deduplicate Geometry |
Point Instancer |
Y |
Y |
Y |
Slight |
Optimize Materials |
Deduplicate |
Y |
Y |
Y |
Y |
Optimize Materials |
Convert to Color |
Y |
Y |
Y |
Y |
Inspecting The Results#
To see what changed in the scene after optimization, switch to the Report tab in the Scene Optimizer UI and inspect the output log generated by each operation. Another way to see changes to the loaded stage within Kit is to open the Statistics window (Window > Utilities > Statistics) to see before and after scene metrics.
Measure the original scene’s baseline hardware usage and current runtime performance to gauge the desired components to be improved:
If reducing memory was the goal, inspect the viewport stats display that shows the current system and GPU memory usage of the loaded scene. If the resulting scene after the optimization processes shows lower memory usage, take note to compare to the original statistics.
If improving performance was the goal, note the original FPS and/or playback speed. Compare these two values for the original scene and after the scene optimizer processes.
Note
Enabling the FPS in the viewport can aid in determining runtime improvements. Ensure it is set to No Pacing to remove any frame rate limiters.
If the specified optimization is not beneficial, try another optimization on the original scene to see if there are any data improvements.
Try Fixing in Source Data Application#
Scene Optimizer may also indicate problems that can be solved in the source data. For example, if the deduplicate option is able to replace a lot of geometry with instances, it may be that there was a problem when the asset was originally created. If possible, replacing geometry with instances in the source tool where the assets were generated can have the additional benefit of improving the performance of the original source data.
Use Caution#
Some optimizations can impact scene performance in positive and negative ways. For example, merging meshes that were originally instances will increase memory usage since each instance must be converted into a new geometry prim and can take up additional memory. This means it is important to decide upfront what tradeoffs are acceptable for the end user consuming the data. If increased memory usage is acceptable to achieve a higher frame rate, then an operation like this is still worthwhile.