Filament: Support for animations

Created on 6 Nov 2018  Â·  10Comments  Â·  Source: google/filament

Basically we would like to load and animate gltf model. Is there any way for doing that with the help of Filament on Android? It seems that filamesh output format does not support animations.

enhancement

Most helpful comment

You can check out http://guillaumeblanc.github.io/ozz-animation/ for an open source library that does just the animation and computation of bone matrices. I think it should combine nicely with filament.
Although it does not support gltf.

All 10 comments

Filament aims to be purely a rendering engine. filamesh is just a small example of an efficient runtime mesh format but it's not intended to support complex use cases such as animations. We are working on a glTF viewer sample app (see PR #456) which may or may not receive animations support at some point. It's based on libassimp's glTF importer.

Note that Filament does support GPU skinning. It just doesn't have an animation engine to animate the bones.

You can check out http://guillaumeblanc.github.io/ozz-animation/ for an open source library that does just the animation and computation of bone matrices. I think it should combine nicely with filament.
Although it does not support gltf.

FYI, its still under development but I'm working on CPU skinning/morphing for glTF 2.0 model > https://github.com/syoyo/tinygltf/tree/skinning/examples/skinning

For low-poly glTF model, I guess CPU implementation of animation would work well in real-time on recent Android devices.

Filament aims to be purely a rendering engine. filamesh is just a small example of an efficient runtime mesh format but it's not intended to support complex use cases such as animations. We are working on a glTF viewer sample app (see PR #456) which may or may not receive animations support at some point. It's based on libassimp's glTF importer.

Note that Filament does support GPU skinning. It just doesn't have an animation engine to animate the bones.

I have been looking around the documentation for anything related to skinned meshes but can't seem to find anything. Is there any examples or further documentation about GPU skinning support?

We recently added a GPU skinning example, it's in JavaScript but is 1:1 with C++. The two interesting spots are vertex buffer / renderable creation:

https://github.com/google/filament/blob/master/web/samples/skinning.html#L83-L102

...and the bones animation that occurs on every frame:

https://github.com/google/filament/blob/master/web/samples/skinning.html#L157

The APIs are:

You can check out http://guillaumeblanc.github.io/ozz-animation/ for an open source library that does _just_ the animation and computation of bone matrices. I think it should combine nicely with filament.
Although it does not support gltf.

I have confused about ozz-animation integration; If possible, please recommend a sample that integrate ozz-animation in filament, or releated info, thanks very much;

For examples of using Ozz, you'll have to check their site/repository.
The only interface between Ozz and Filament are the bone matrices.
You can get those from Ozz using the "LocalToModelJob" (http://guillaumeblanc.github.io/ozz-animation/documentation/animation_runtime/#ozzanimationblendingjob), after having animated your skeleton in whatever way you wish.
For this to make any sense, you'll also have to use the same order for bones in both the Ozz skeleton and your Filament mesh (when you link vertices to bones in the vertex array data).

@prideout is working on a new gltf viewer implementation that brings animations support btw.

Closing. Please see libs/gltfio/include/gltfio/Animator.h.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Realitian picture Realitian  Â·  5Comments

roxlu picture roxlu  Â·  3Comments

jiqimaogou picture jiqimaogou  Â·  6Comments

rfebbo picture rfebbo  Â·  3Comments

vivasvan1 picture vivasvan1  Â·  8Comments