Skip to content

Commit 9d21b17

Browse files
Merge pull request #116796 from FlorianBorn71/Instancing
A section about memory optimizations and instancing
2 parents 590cd83 + d52bcb8 commit 9d21b17

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

articles/remote-rendering/how-tos/conversion/configure-model-conversion.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,51 @@ By default the converter has to assume that you may want to use PBR materials on
198198

199199
Knowing that you never need dynamic lighting on the model, and knowing that all texture coordinates are in `[0; 1]` range, you can set `normal`, `tangent`, and `binormal` to `NONE` and `texcoord0` to half precision (`16_16_FLOAT`), resulting in only 16 bytes per :::no-loc text="vertex":::. Cutting the mesh data in half enables you to load larger models and potentially improves performance.
200200

201+
## Memory optimizations
202+
203+
Memory consumption of loaded content may become a bottleneck on the rendering system. If the memory payload becomes too large, it may compromise rendering performance or cause the model to not load altogether. This paragraph discusses some important strategies to reduce the memory footprint.
204+
205+
### Instancing
206+
207+
Instancing is a concept where meshes are reused for parts with distinct spatial transformations, as opposed to every part referencing its own unique geometry. Instancing has significant impact on the memory footprint.
208+
Example use cases for instancing are the screws in an engine model or chairs in an architectural model.
209+
210+
> [!NOTE]
211+
> Instancing can improve the memory consumption (and thus loading times) significantly, however the improvements on the rendering performance side are insignificant.
212+
213+
The conversion service respects instancing if parts are marked up accordingly in the source file. However, conversion does not perform additional deep analysis of mesh data to identify reusable parts. Thus the content creation tool and its export pipeline are the decisive criteria for proper instancing setup.
214+
215+
A simple way to test whether instancing information gets preserved during conversion is to have a look at the [output statistics](get-information.md#example-info-file), specifically the `numMeshPartsInstanced` member. If the value for `numMeshPartsInstanced` is larger than zero, it indicates that meshes are shared across instances.
216+
217+
#### Example: Instancing setup in 3ds Max
218+
219+
[Autodesk 3ds Max](https://www.autodesk.de/products/3ds-max) has distinct object cloning modes called **`Copy`**, **`Instance`**, and **`Reference`** that behave differently with regards to instancing in the exported `.fbx` file.
220+
221+
![Cloning in 3ds Max](./media/3dsmax-clone-object.png)
222+
223+
* **`Copy`** : In this mode the mesh is cloned, so no instancing is used (`numMeshPartsInstanced` = 0).
224+
* **`Instance`** : The two objects share the same mesh, so instancing is used (`numMeshPartsInstanced` = 1).
225+
* **`Reference`** : Distinct modifiers can be applied to the geometries, so the exporter chooses a conservative approach and does not use instancing (`numMeshPartsInstanced` = 0).
226+
227+
228+
### Depth-based composition mode
229+
230+
If memory is a concern, configure the renderer with the [depth-based composition mode](../../concepts/rendering-modes.md#depthbasedcomposition-mode). In this mode, GPU payload is distributed across multiple GPUs.
231+
232+
### Decrease vertex size
233+
234+
As discussed in the [best practices for component format changes](configure-model-conversion.md#best-practices-for-component-format-changes) section, adjusting the vertex format can decrease the memory footprint. However, this option should be the last resort.
235+
236+
### Texture sizes
237+
238+
Depending on the type of scenario, the amount of texture data may outweigh the memory used for mesh data. Photogrammetry models are candidates.
239+
The conversion configuration does not provide a way to automatically scale down textures. If necessary, texture scaling has to be done as a client-side pre-processing step. The conversion step however does pick a suitable [texture compression format](https://docs.microsoft.com/windows/win32/direct3d11/texture-block-compression-in-direct3d-11):
240+
241+
* `BC1` for opaque color textures
242+
* `BC7` for source color textures with alpha channel
243+
244+
Since format `BC7` has twice the memory footprint compared to `BC1`, it is important to make sure that the input textures do not provide an alpha channel unnecessarily.
245+
201246
## Typical use cases
202247

203248
Finding good import settings for a given use case can be a tedious process. On the other hand, conversion settings may have a significant impact on runtime performance.
487 KB
Loading

0 commit comments

Comments
 (0)