Scene Optimizer: What Options Should I Choose?

Consider What To Solve

The scene optimizer has a range of options that can be applied to a scene. It is possible to apply one or more of these options to a scene. Determining which options to pick is not always easy. It depends on the specific characteristics of the scene you are working with, and the type of optimization you want to achieve. Below are some guidelines for how to proceed, and why these choices might be good ones to make.

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:

  • Scene uses too much memory, either system memory or video memory

  • Scene is too slow to interact with, either tumbling the camera or playing back animation.

  • Load time.

If the scene uses too much memory, look for optimizations that reduce the resources needed by the scene. Specific examples would be:

  • Deduplication
    • This replaces multiple copies of meshes with a single copy plus references to that copy. Since a reference to a copy needs less memory than the full mesh, this option can reduce memory usage. It can affect both system memory and GPU memory, since the meshes are stored in both places.

    Note

    This is only effective if there are meshes that are identical but are not already instances. So you may find this optimization has no effect on your scene. To check, look at the scene statistics printed to the console before and after the optimization.

  • Optimize materials
    • If a scene has a very large number of materials, it is possible there may be duplicate materials. Run this optimization to replace duplicates with references to unique materials. This can reduce memory usage and also improve performance.

    • Convert to color
      • This is an option on Optimize Materials that replaces materials with color per vertex. If there are a lot of materials in the scene this will significantly reduce 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.

If the scene is too slow to tumble or to play back, look for optimizations that reduce the number of objects in the scene. A large number of prims in the scene can affect performance significantly. Specific examples would be:

  • Merge meshes
    • This replaces multiple meshes that share common properties with single meshes. This reduces scene prim count, and so can improve performance. Note that because the total amount of geometry does not change, this option will not reduce memory consumption.

    • If you want to edit materials but not other properties of the meshes, consider the Merge by material option. This merges together all meshes of the same material, so if you later want to change that material you can do so. The performance gains may not be as great as merging all meshes, but the extra degree of control may be worth the cost.

      Caution

      Once merged, you can no longer edit individual original meshes, but only the new merged mesh prims.

  • Optimize skeleton roots
    • This is 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 above, this will not significantly reduce memory usage.

If a scene has high load time, both of these sets of optimizations may be useful. Reducing memory (and therefore scene size) and speeding up scene evaluation can improve the time it takes to load and render a scene.

Other Tools

These tools do not directly affect scene performance, but may affect usability and workflows:

  • Pivot
    • This will place the parent transform at the center of the bounding box of the mesh. 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 this option on an imported scene can therefore potentially help performance.

Advanced Functionality

  • Python Script
    • This operation will execute python code with access to the Usd Stage. USers can make 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.

Note

This is a python only feature and cannot be used from the standalone application.

Summary of Expected Performance Improvements

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

Deduplicate

Instances

Y

Y

N

Slight

Deduplicate

Materials

Y

Y

Y

Y

Inspecting The Results

To see what changed in the scene after optimization, open the console and look at the end of the log. The scene optimizer prints out scene statistics before and after the optimization has been applied, so you can immediately see if the optimization changed the scene in a significant way.

The real test is obviously to measure the scene characteristics you were trying to improve in the first place:

  • If reducing memory was the goal, open the HUD and display the system and GPU memory statistics to see the memory usage of the scene. If the optimization was useful, you should see the numbers drop once the scene optimizer completes the operation.

  • If improving performance was the goal, test tumble or playback speed before and after the scene optimizer run.

    • Enabling the FPS in the viewport can aid in determining improvements.

If the optimization is not beneficial, revert it and try another optimization.

The 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 it is possible, replacing geometry with instances in the original tool where the assets were generated can have the additional benefit of improving the performance of your asset in that tool as well.

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 geometry, which takes up additional memory. This means it is important to decide upfront what tradeoffs are acceptable. If increased memory usage is acceptable to achieve a higher frame rate, then an operation like this is still worthwhile.