KhronosGroup / glTF-Sample-Assets

To store all models and other assets related to glTF

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Suggestion: Sample with discrete/constant interpolation of scale 0↔1

donmccurdy opened this issue · comments

In a thread on the three.js forums we've come to the conclusion that a significant number of viewers cannot display constant interpolation of scale, particularly scale 0↔1.

  • ✅ three.js
  • ✅ PlayCanvas
  • ❌ Babylon.js
  • ❌ Khronos Sample Viewer
  • ❌ Spark AR

The 'broken' three each show slightly different results — Spark AR doesn't appear to support constant interpolation at all, whereas Babylon.js plays the animation correctly once and then reaches a broken state when trying to loop it.

It's a useful technique for 'baking' simulations as flipbook-style animations, showing each mesh for a single frame, but does depend on correct support for animating scale with constant interpolation.

This has been untouched for over a year. Is there anything to do here?

If there is no response, then this issue will be closed by 27 Nov.

Babylon.js has already fixed this, but a sample model could still be useful.

By "constant", you mean STEP interpolation?

There is a pending PR for the InterpolationTest at #26 . I could just change the values of the respective accessor...

  accessor10.setArray(new Float32Array([
    1, 1, 1, 
    0.5, 0.5, 0.5,  // Change to 0 0 0
    1, 1, 1, 
    0.5, 0.5, 0.5,  // Change to 0 0 0
    1, 1, 1
  ]));

if this is it...

Yes, thanks – STEP interpolation with scale is what I had in mind.

This is what the InterpolationTest could look like with a scale of 0:

Khronos InterpolationTestScale0

An archive with the GLB and the code (hand-edited output of gltfTransformifier) for generating it:

InterpolationTestFix0004_scale0.zip

If people agree, I can update #26 with this.

An archive with the GLB and the code (hand-edited output of gltfTransformifier) for generating it:

total aside, but that is a wild and beautiful solution 🤯

OT: The name was inspired by BCELifier. It's a very rough "proof-of-concept" for now, but I try to allocate some time to maybe turn it into something useful.

I have updated the PR at #26 (comment) with the latest state that was posted here, where the scale interpolations go down to (0,0,0). When this PR is merged, then this issue can probably be closed.

The current version of the InterpolationTest at https://github.com/KhronosGroup/glTF-Sample-Assets/tree/main/Models/InterpolationTest now includes a STEP interpolation that scales between 0.0 and 1.0, so I assume that this can be closed.