Filament: Animations appear to not be sampled correctly

Created on 25 Sep 2020  路  5Comments  路  Source: google/filament

I have an animation where cubes are supposed to appear (scaled from 0 to 1), but Filament does not animate to the correct target value, leaving the cubes in an intermediary state. Other engines animate this correctly.

The following is a screenshot of how the cubes look like after they have been animated in by Filament. Notice that for the top six cubes I have removed the rotation and location keyframes, so only their scale is off.
grafik

The cubes should look like the following, rendered in Bablylon.js.
grafik

To Reproduce
Unfortunately, I could not create a new, minimal reproducing example. But I've managed to simplify the original offending file.

  1. Open animation-test.zip in Blender.
  2. Export as glTF (which results in animation-test-gltf.zip):

    • as glTF Embedded (.gltf),

    • disable Animation/Animation/Group by NLA Track

  3. Open in VSCode and preview with the glTF Tools plugin.
  4. With the default engine, activate animations. The cubes are placed correctly.
  5. Choose the Filament rendering engine and activate animations. The cubes are not placed correctly.

Expected behavior
Animations should hit the target value.

Devices
Debugged on a Windows 10 machine, where the VSCode plugin offers a preview with Filament 1.8.1.

The same behavior also happens on Android devices in AR; the cubes there are also misplaced, which prompted the investigation.

bug gltfio

Most helpful comment

The bug is in applyAnimation when lower_bound returns end(). When this occurs, it abandons the channel by doing a continue. The fix is to apply the last value rather than doing a continue.

All 5 comments

I can reproduce the bug in the latest gltf_viewer. Thanks!

Thanks for this excellent bug report, I see what's going on, fix is on the way.

Great to hear that you found the issue! I just couldn't figure it out.

Once it's fixed, if you have the time, I'm curious to hear what the issue was, roughly. I want to understand what I missed. ;)

The bug is in applyAnimation when lower_bound returns end(). When this occurs, it abandons the channel by doing a continue. The fix is to apply the last value rather than doing a continue.

What an amazingly quick response! Thank you for your work!

Was this page helpful?
0 / 5 - 0 ratings