KHR_animation_pointer with UV transforms

Hi there Babylon friends!

This model tests UV transform animations for position, scale, and rotation with KHR_animation_pointer:

At the moment, Babylon.js Sandbox only seems to animate some of the textures, but not others. None of them show rotation transform animation.

The only animations that seem to work currently:

  • baseColorTexture: position, scale
  • occlusionTexture: position, scale
  • emissiveTexture: position, scale

I hope this asset helps!

1 Like

cc @sebavan and @bghgary

Direct link to sandbox: Babylon.js - AnimationPointerUVs.gltf (babylonjs.com)

1 Like

@echadwick-artist I’m still investigating, but at least one problem is that all of the rotation pointers are incorrect in the asset. I gave you a comment in your PR.

2 Likes

Thanks for that! I submitted a fixed version.

Sandbox with the fixes: Babylon.js Sandbox - View glTF, glb, obj and babylon files

2 Likes

@echadwick-artist
I got everything working locally except for metallic and roughness. It seems, in the asset, these are not animated. I’m not sure what you were trying to do with these. Metallic and roughness textures are packed together, but it seems you are trying to animate them separately. Maybe that’s causing an issue in the exporter or something? There are no animations that target the corresponding metallic or roughness materials (/materials/3 to /materials/6) in the asset.

@echadwick-artist

This PR will make everything work except for an issue with the transmission texture. @sebavan and I are looking into that.

Here is a direct sandbox link with the changes from the PR: Babylon.js - AnimationPointerUVs.gltf (babylonjs.com). Everything should be working except for metallic, roughness, and transmission textures.

Also note that I added a PR comment about some bad animation pointers in the asset: AnimationPointerUVs by echadwick-artist · Pull Request #115 · KhronosGroup/glTF-Sample-Assets (github.com)

I will also point out that some of the textures are really hard to see in this asset. Maybe you can tweak the values to make them more obvious?

The last one will be fixed by Fix PBR sub surface Dirty mecanism on textures by sebavan · Pull Request #14917 · BabylonJS/Babylon.js · GitHub

2 Likes

Direct link to sandbox from PR: Babylon.js - AnimationPointerUVs.gltf (babylonjs.com)

1 Like

The fixes are live now.

Thank you for the quick work!

I am seeing a new issue, and I’m wondering if this is something to fix in the HS glTF Exporter for 3ds Max? I am conversing regularly with the developer of this plugin.

This glTF example is designed to animate the two glTF Properties occlusionTexture and metallicRoughnessTexture, with each using the same PNG texture. The glTF Property baseColorTexture is not animated, to act as a control.

  1. https://sandbox.babylonjs.com:
    glTF cannot be rendered, instead an error Unable to load from file:animationPointerUVs_2024-03-30.gltf: Cannot read properties of undefined (reading 'getLocalMatrix')

  2. http://gltf.ux3d.io/:
    Loads OK, but the root transform is incorrect. However the animation is correct.

  3. VS Code with Babylon.js preview:
    glTF loads properly. However, only the occlusionTexture is animated. The metallicRoughnessTexture should also be animated but is not.

glTF_animationPointer_ORM.zip (475.6 KB)

glTF_animationPointerUVs_O-RM.zip (483.9 KB)

Another variation on that setup: Top row has occlusionTexture being animated, while metallicRoughnessTexture not animated. Bottom row is the reverse: occlusionTexture is not animated, while metallicRoughnessTexture is animated.

  1. https://sandbox.babylonjs.com: same error as before.

  2. http://gltf.ux3d.io/:
    Loads OK, but the root transform is incorrect. However the animation is correct.

  3. VS Code with Babylon.js preview:
    glTF loads properly. However, only the occlusionTexture is animated. The metallicRoughnessTexture should be animated in the bottom row but is not.

This is a bug in the new code. I will fix it.

1 Like

Fixed here: Fix glTF animation pointer of metallic roughness texture by bghgary · Pull Request #14936 · BabylonJS/Babylon.js (github.com)

@echadwick-artist When you are done with all the new assets, it would be great if we can include them in our visual tests to make sure these are all working and continue working. Are you planning to create a bunch of assets to cover the bases?

2 Likes