Skip to content

Incorrect rendering of Morph Targets on GLB model #9309

@DipokalLab

Description

@DipokalLab

Describe the bug
I'm having an issue where after displaying a GLB file with Filament and adjusting the morph values, it renders strangely, unlike how it's controlled in Blender or three.js.

So, the issue is that the morph targets aren't animating as intended.

Basically, when I display the model on https://gltf-viewer.donmccurdy.com/, all the morph targets work as defined. However, the problem only occurs in Filament.

To Reproduce
Steps to reproduce the behavior:

  1. build.gradle.kts
   implementation("com.google.android.filament:filament-android:1.65.2")
   implementation("com.google.android.filament:gltfio-android:1.65.2")
   implementation("com.google.android.filament:filament-utils-android:1.65.2")
  1. and loaded glb
            avatarView.post {
                avatarRenderer = AvatarRenderer(avatarView).apply {
                    setupViewer(distance = 10.0f)
                    addDirectionalLight()
                    loadAvatarGlbFrontFacing("avatar.glb")
                    start() // start render loop
                }
            }
  1. on doFrame like this
    override fun doFrame(frameTimeNanos: Long) {
        if (avatarReady) {
            for (i in frameWeights.indices) {
                frameWeights[i] = kotlin.random.Random.nextFloat() // make random move
            }
            applyW68(frameWeights) // apply 68 morph targets
        }

        modelViewer?.render(frameTimeNanos)
        choreographer?.postFrameCallback(this)
    }

Expected behavior
The expected behavior is for 68 morph targets to animate mouth movement and eye blinks by randomly varying their weights between 0 and 1.

When the morph target is moved, it should move accurately as shown in the picture below.

Image

Screenshots
https://github.com/user-attachments/assets/18ffa191-3ff7-4dab-8d31-f0e7ca9cef69

Image

Logs
...

Desktop (please complete the following information):

  • OS: macOS 15.6.1 / M3 Pro
  • GPU: M3 Pro
  • Backend: OpenGL

Smartphone (please complete the following information):

  • Device: Samsung S22 and Virtual Device
  • OS: Android 14

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions