MorphTargetBuffer
A container for vertex morphing data that supports both automatic and manual morphing.
MorphTargetBuffer operates in a hybrid model depending on the attribute being morphed:
1. Automatic for Built-ins (positions/tangents): Enable via withPositions(true) or withTangents(true). The MorphTargetBuffer will allocate internal storage and hold the data for these attributes, which you upload via setPositionsAt() or setTangentsAt(). The framework automatically applies the morphing logic in the vertex shader.
2. Manual for Custom Data (e.g., UVs, colors): The MorphTargetBuffer does NOT hold data for custom targets. The user is responsible for the full data pipeline:
Create and manage a separate Texture to hold the morph target data (offsets).
In the material, declare a
sampler2d_arrayparameter.Bind the Texture to the material instance.
In the vertex shader, manually call
morphData2,morphData3, ormorphData4with the custom sampler to apply the morphing.
A MorphTargetBuffer object must be associated with a Renderable via RenderableManager.Builder.morphing() to enable the morphing pipeline.
See also
Types
Properties
Indicates whether this buffer supports automatic position morphing.
Indicates whether this buffer supports automatic tangent morphing.
Indicates whether custom morphing is enabled for user-defined attributes.
The native object, for interop with code calling the Fila* C API directly. Read-only: this wrapper owns it.
Gets the number of vertices this MorphTargetBuffer can hold.
Functions
Updates positions for the given morph target. Requires a buffer built with withPositions(true); the 4th component is 1.0.
Updates tangents for the given morph target. Requires a buffer built with withTangents(true).