Asset Optimization

Learning Objectives

This tutorial details how to make robot assets more performant and where to find tradeoffs to achieve a faster simulation or rendering time.

20-30 Minutes Tutorial

Getting Started

Prerequisites

Loading the Robot

This tutorial explores the NVIDIA Kaya Robot asset. Import the Onshape version from Onshape’s CAD assets. You can copy and paste the URL in the Onshape importer search bar, then double-click on the result to import. After it loads:

  1. Create a new stage without the reference added during import.

  2. Save this stage with the name kaya_optimized.usd in the same folder as the imported assets. You can locate the source file in the Reference or Payload section on the Property panel and click the Locate file icon.

  3. Open the Layer tab and drag the NVIDIA_Kaya_Robot_edit.usd into the Root Layer. NVIDIA_Kaya_Robot_base.usd is the clean stage post-import from Onshape. Avoid directly editing it to facilitate updates when the asset is re-imported from Onshape.

This process ensures that the source asset is preserved until you are ready to commit all changes.

Merging Meshes

Begin by simplifying the asset USD tree with Merged Meshes. This reduces the prim count and makes many processes more performant, but it does not reduce memory consumption.

  1. Open the Merge Mesh Tool: Isaac Utils > Merge Mesh Tool.

  2. Select all main body components by clicking Kaya_Motor_Bottom_Plate_02 and shift-clicking into Kaya_Terminal_Block_Cover.

  3. Check Deactivate Source Assets.

  4. Check Combine Materials and type /World/Looks in the text box. This provides a destination for the combined materials to be cloned in the current folder.

  5. Click MERGE.

  6. Navigate to the merged folder and rename the merged mesh to the same name as the rigid body that it will be part of: Main_Body.

  7. Drag the merged mesh into /World.

For the wheel, there are a few additional steps to the process so we can reuse the same asset for all wheels:

  1. Create three Xforms to be used as reference.

  2. Select /World/NVIDIA_Kaya_Robot/MX_12W_Drive_Wheel_ASM/MX_12W/Dynamixel_axis/axis_group/Kaya_Wheel_Hub_Inside, /World/NVIDIA_Kaya_Robot/MX_12W_Drive_Wheel_ASM_01/MX_12W/Dynamixel_axis/axis_group/Kaya_Wheel_Hub_Inside, and /World/NVIDIA_Kaya_Robot/MX_12W_Drive_Wheel_ASM_02/MX_12W/Dynamixel_axis/axis_group/Kaya_Wheel_Hub_Inside.

  3. Uncheck their Instanceable checkbox.

  4. Drag each Xform inside each of the prims from the last step.

  5. If the Xform is at the origin (Translate and Orient set to zero), go to Edit > Preferences > Stage and check Keep World Prim when Reparenting. Otherwise, set all translate and orient attributes to zero.

  6. Drag each Xform created into their respective Dynamixel_axis parent.

  7. Rename one of the Xforms to Dynamixel_Axis.

  8. Select every other sibling of that Xform and reparent them into it.

  9. Select the Xform that was created and renamed to Dynamixel_Axis.

  10. Click MERGE.

  11. Drag the merged mesh into /World.

  12. Save the layer.

The other wheel hubs don’t need to be merged because the first one is reused as a reference for all wheels. It is also not necessary to merge the rollers because they are a single-mesh asset already.

Reusing Duplicate Geometries

To avoid excess memory consumption by geometries that are fundamentally the same, you must identify duplicate meshes and replace them with the same instance. To do that:

  1. Create a new SubLayer for the main body and for the wheel hub. Call these layers main_body.usd and wheel_hub.usd and save them in a folder called Instances, which you create in the same folder as the other assets.

  2. Drag /World/Looks and /World/Main_Body into the main body layer.

  3. Save the main_body.usd layer only.

  4. Remove any transform from /World/Dynamixel_axis.

  5. Drag /World/Looks (from the main body layer) and /World/Dynamixel_axis into the wheel hub layer.

  6. Save the wheel_hub.usd layer only.

  7. Drag /World/Looks to the root layer.

  8. Remove the main_body and wheel_hub SubLayers.

  9. Save the root layer only.

This moves the newly merged meshes to their own USDs and copies the Looks folder.

With this process, you minimized the USD complexity and ensured that all meshes of the asset are defined as instanceable. Furthermore, you are able to retain a full history of the original asset. If you ever need to go back to un-merged prims to make some adjustments or if you import an updated version of the robot, reverting some of the changes is possible by removing the deltas from the base asset.

Other Considerations

  • Minimize Number of Lights: Each light negatively impacts the performance of the rendering. By default, if the scene has more than 10 lights, the rendering reverts to sample-based lighting to avoid severe slowdown in performance.

  • Reduce Translucent Materials: Each translucent material generates a larger performance bottleneck than the default OmniPBR material.

  • Optimize Physics Performance: Search for simulation aspects that you can modify to reduce computational cost. Typically, colliders have high computational costs. The more basic that you can make a collision shape, the more performant the simulation behaves. Reducing the number of contact points can also bring huge performance benefits. Tuning this can take several experiments to achieve the best precision versus performance point for your situation.