Instancing QML Type
Base type for instance tables. More...
| Import Statement: | import QtQuick3D . |
| Instantiates: | QQuick3DInstancing |
| Inherits: | |
| Inherited By: |
Properties
- hasTransparency : bool
- instanceCountOverride : int
Detailed Description
Instancing allows duplicating a model with variations. In contrast to using a Repeater3D, the model and its graphics resources are only allocated once. The rendering of the duplicated instances is done at a low level by the GPU, with a single draw call. Depending on the complexity of the model, this can give a performance improvement of several orders of magnitude.
In practice, instancing is done by defining a table that specifies how each instance is modified relative to the base model. The table has an entry for each index, containing a transform matrix, a color, and generic data for use by custom materials.
To use instancing, set its instancing property to reference an Instancing object.
An application can define an Instancing object in C++ by subclassing QQuick3DInstancing, or it can use one of the pre-defined QML types: InstanceList or RandomInstancing.
Property Documentation
Set this property to true if the instancing table contains alpha values that should be used when rendering the model. This property only makes a difference if the model is opaque: If the model has a transparent material, or an opacity less than one, the alpha value from the table will be used regardless.
Set this property to limit the number of instances without regenerating or re-uploading the instance table. This allows very inexpensive animation of the number of instances rendered.