Instancing QML Type

Base type for instance tables. 更多...

导入语句: import QtQuick3D
Since: Qt 6.2
实例化: QQuick3DInstancing
继承: Object3D
继承者: FileInstancing , InstanceList ,和 RandomInstancing

特性

详细描述

实例化渲染 allows duplicating a model with variations.

The Instancing type defines 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 a model's 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 FileInstancing ,或 RandomInstancing . In addition, it is possible to use a particle system to define an instancing table by using the ModelParticle3D.instanceTable 特性。

特性文档编制

depthSortingEnabled : bool

Holds the depth sorting enabled value for the instance table. When enabled, instances are sorted and rendered from the furthest instance from the camera to the nearest i.e. back-to-front. If disabled, which is the default, instances are rendered in the order they are specified in the instance table.

注意: The instances are only sorted against each other. Instances are not sorted against other objects in the scene.

注意: The sorting increases the frame preparation time especially with large instance counts.

hasTransparency : bool

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 ,或 opacity less than one, the alpha value from the table will be used regardless.

注意: Enabling alpha blending may cause rendering issues when instances overlap. See the alpha blending and instancing 文档编制了解细节。

instanceCountOverride : int

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.