Point Level Animation

Hi there!
I’m not sure if there is a concrete question here… But i’d like to be pointed to the right direction regarding this issue.

I am not sure if Playcanvas has support for per vertex animation, but I noticed the model viewer does offer some kind of support by creating a morph target for every frame, although I haven’t yet figured out what are the export configurations to acheive that.

What I am trying to do here is use PLA animations (or per vertex animations) in my models.
Here’s the result so far: https://launch.playcanvas.com/1262505?debug=true

To acheive this I do three steps:

  1. Import a mesh for every frame and store the positions, indices and normals
  2. Create and download a json file containing all the data
  3. Use that json file data to set the positions, indices and normals and redraw the mesh on each frame.

Here’s a link to the proyect:
https://playcanvas.com/editor/scene/1262505

I don’t actually NEED the json, but it helps holding data toghether.
The downside is that it’s pretty expensive storage-wise… the json asset alone is 20.5Mb for a 3 second animation (90 frames at 30fps for a 3.2K poly mesh).

I can imagine some improvements ignoring every other frame and tweening linearly between the remaining ones. That could down the file size to half or a third maybe at the expense of rendering a less accurate animation.

So the question here is:
Can anyone think of a better way to do this? :sweat_smile: Something tells me there has to be a faster/ lighter way

Sorry for the long post, and thanks for reading!

Hey, that’s super interesting, thanks for sharing!

Reducing the FPS and tweening linearly would definitely help.

Note that when gZIP compression is applied to text assets, download size gets down a lot. In the PlayCanvas server it’s applied by default, so the actual download size of this file is around 7.5MB:

image

1 Like

As you said, you could export frames at lower frequency, create MorphTargets from them, and then interpolate between them. See some examples here:

http://playcanvas.github.io/#/graphics/mesh-morph
http://playcanvas.github.io/#/graphics/mesh-morph-many

2 Likes

In theory you could export those into glb as well as morph targets, but I’m not sure your authoring pipeline allows you to set it up that way.

Ohh, so that’s why it didn’t impact so much on loading time. Thanks for clarifying this!

1 Like

I’ll give this a try soon, thanks!