Back to Filament

morphing

docs/android/dokka/filament-android/com.google.android.filament/-renderable-manager/-builder/morphing.md

1.75.02.5 KB
Original Source

//filament-android/com.google.android.filament/RenderableManager/Builder/morphing

morphing

[main]
open fun morphing(targetCount: Int): RenderableManager.Builder

Controls if the renderable has legacy vertex morphing targets, zero by default. For legacy morphing, the attached VertexBuffer must provide data in the appropriate VertexBuffer.VertexAttribute slots (MORPH_POSITION_0 etc). Legacy morphing only supports up to 4 morph targets and will be deprecated in the future. Legacy morphing must be enabled on the material definition: either via the legacyMorphing material attribute or by calling ::useLegacyMorphing.

See also setMorphWeights, which can be called on a per-frame basis to advance the animation.

[main]
open fun morphing(morphTargetBuffer: MorphTargetBuffer): RenderableManager.Builder

Controls if the renderable has vertex morphing targets, zero by default.

For standard morphing, A MorphTargetBuffer must be provided. Standard morphing supports up to CONFIG_MAX_MORPH_TARGET_COUNT morph targets.

See also setMorphWeights, which can be called on a per-frame basis to advance the animation.

[main]
open fun morphing(level: Int, primitiveIndex: Int, offset: Int): RenderableManager.Builder

Specifies the morph target buffer for a primitive. The morph target buffer must have an associated renderable and geometry. Two conditions must be met: 1. The number of morph targets in the buffer must equal the renderable's morph target count. 2. The vertex count of each morph target must equal the geometry's vertex count.

Parameters

main

levelthe level of detail (lod), only 0 can be specified
primitiveIndexzero-based index of the primitive, must be less than the count passed to Builder constructor
offsetspecifies where in the morph target buffer to start reading (expressed as a number of vertices)