Skip to content

Commit e44bbb6

Browse files
authored
Merge pull request #10762 from Calinou/mesh-automatic-instancing
Clarify the behavior of MeshInstance3D automatic instancing
2 parents 1d3bf85 + 146182c commit e44bbb6

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

contributing/development/core_and_modules/internal_rendering_architecture.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -450,9 +450,10 @@ used to calculate particle collisions in 2D.
450450
Batching and instancing
451451
~~~~~~~~~~~~~~~~~~~~~~~
452452

453-
In the Forward+ renderer, Vulkan instancing is used to group rendering
454-
of identical objects for performance. This is not as fast as static mesh
455-
merging, but it still allows instances to be culled individually.
453+
In the Forward+ renderer, Vulkan instancing is used to group rendering of
454+
identical opaque or alpha-tested objects for performance. (Alpha-blended objects
455+
are never instanced.) This is not as fast as static mesh merging, but it still
456+
allows instances to be culled individually.
456457

457458
Light, decal and reflection probe rendering
458459
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tutorials/performance/optimizing_3d_performance.rst

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,22 @@ the viewer a considerable distance for the angle of view to change
104104
significantly. This can be complex to get working, but may be worth it depending
105105
on the type of project you are making.
106106

107-
Use instancing (MultiMesh)
108-
~~~~~~~~~~~~~~~~~~~~~~~~~~
107+
Use automatic instancing
108+
~~~~~~~~~~~~~~~~~~~~~~~~
109+
110+
*This is only implemented in the Forward+ renderer, not Mobile or Compatibility.*
111+
112+
If you have many identical objects in your scene, you can use automatic
113+
instancing to reduce the number of draw calls. This automatically happens for
114+
MeshInstance3D nodes that use the same mesh and material: no manual setup is required.
115+
116+
For automatic instancing to be effective, the material must be opaque or
117+
alpha-tested (alpha scissor or alpha hash). Alpha-blended or depth pre-pass
118+
materials are never instanced this way. Instead, you must use MultiMesh as
119+
described below.
120+
121+
Use manual instancing (MultiMesh)
122+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
109123

110124
If several identical objects have to be drawn in the same place or nearby, try
111125
using :ref:`MultiMesh <class_MultiMesh>` instead. MultiMesh allows the drawing

0 commit comments

Comments
 (0)