Optimization guidelines
The frame rate must be optimal for real-time 3D applications.
You can reduce the frame rate of CAD models to less than 60 frames per second. CAD models may have complex topologies, which translates into a high polygon count, but may also have many parts and materials, which translates into many draw calls.
Reduce the polygon count
When you import 3D models, Pixyz runs a generic optimization process. By adjusting import parameters, you can customize optimization, for example to control the overall quality of imported meshes.
Tessellation algorithms and decimation algorithms use these parameters to lower the polygon count until the target quality level is reached. To create different quality levels, generate levels of detail (LODs) at import.
If the polygon count is still too high after import, you can apply other strategies, depending on your model and your needs. You can process models in different ways:
- Manually using the Toolbox
- Automatically using the Rule Engine
Decimate your model
The most common way to reduce the polygon count is to decimate meshes. You can decimate meshes at import.
Decimation works up to a certain limit, after which geometries are too damaged.
From the Pixyz menu, choose Toolbox > Mesh > Decimate.
Delete occluded geometries
You can delete inside geometries.
This processing proves particularly efficient on these models:
- Models that have internal parts
- Models that have been designed as solids
- Models that have been designed using CAD software*
Retopologize meshes to create a rough mesh
You can bake the normals map to mimic slight surface changes while reducing the polygon count.
You can retopologize meshes for LODs.
Reduce the number of draw calls
A draw call is a command that is sent by the CPU to the GPU to draw something on screen. Because the CPU and the GPU have different purposes, they only briefly communicate during the rendering of a single frame.
The more time is spent on draw calls, the less time is left for the GPU to execute these commands during the remaining frame time. A good strategy is to reduce the number of draw calls or to group commands into a single batch command.
Note
Unity has capability to optimize the number of draw calls, for example through static batching, dynamic batching, and instancing of GPUs. These features work well in many cases, especially for games where many objects are instantiated multiple times. However, in the industry, the number of objects (parts) is much higher. Unity is often unable to batch these draw calls efficiently. ECS (or DOTS) improves performance by simplifying memory layout and allowing more effective compilation of code. However, ECS doesn't fix such draw call issues, even if it can heavily leverage the instancing of GPUs.
We recommend that you simplify the product structure and reduce the number of submeshes.
Merging is the easiest way to reduce the number of draw calls, but has two disadvantages:
- Merging flattens the hierarchy. You can choose to merge models at specific levels, to merge only the subassemblies that represent a set.
- Merging destroys the instances of a same object. If your assembly mainly consists of many instances, merging might not be greatly beneficial.
You can merge models in different ways:
- Merge models at import, with the Hierarchy parameter.
- Merge models afterward using one of these features:
- Merge models at specific levels. Use the Rule Engine to merge only the subassemblies that can be considered as a whole. However, if your assembly mainly consists of many instances of the same object, merging may not be beneficial because it destroys instances.
You can retopologize meshes for these purposes:
- Reduce the polygon count
- Reduce the number of meshes
- Reduce the number of draw calls for materials