KHR_animation_pointer with UV transforms

I’m not sure what’s needed for test assets.

I am planning to make a test scene that animates UV transforms for each of the current texture inputs, including extensions. Here it is in progress:

2 Likes

It’s not live yet, but you can use this link to test: Babylon.js Sandbox - View glTF, glb, obj and babylon files

OK we’re getting closer, bit by bit! Thanks so much, you folks rock.

At this point, everything’s working, except Anisotropy. I still have more animations to add, but this is where I’m at so far.

2024-04-02_with_Anisotropy.zip (4.7 MB)

Doh. I made a copy and paste error for anisotropy. :man_facepalming:

I fixed this locally, but the asset also doesn’t animate any anisotropy texture properties.

Fix typo in glTF animation pointer data by bghgary · Pull Request #14942 · BabylonJS/Babylon.js (github.com)

OK I’ve added all the glTF texture slots.

Most of them seem to be rendering correctly here, except:

  1. anisotropy
  2. diffuse_transmission (I added a strong spotlight behind these spheres)
  3. iridescence

Some of these could be exporter errors, I’ll check with the developer. But perhaps some could be on the rendering side?

animationPointerUVs_2024-04-03.zip (6.3 MB)

Like I said earlier, none of the anisotropy texture properties are being animated in the asset and thus nothing is happening in the rendering.

There is no mention of diffuse transmission in this asset. But even if it did, Babylon.js doesn’t support this extension yet.

This is missing from the animation pointer implementation. I’ll look into it.

I fixed this locally, but it still doesn’t work because the iridescence spheres have no UVs.

This is also caught by the validator:

Material is incompatible with mesh primitive: Texture binding '/materials/47/extensions/KHR_materials_iridescence/iridescenceTexture' needs 'TEXCOORD_0' attribute.glTF Validator(MESH_PRIMITIVE_TOO_FEW_TEXCOORDS)

The animation is also animating the U values to negative numbers. Not sure if that is intentional.

Added missing entries in this PR: Add missing iridescence textures to animation pointer data by bghgary · Pull Request #14945 · BabylonJS/Babylon.js (github.com)

1 Like

I think the asset issues are fixed? I’m not sure how to check the animation data.
animationPointerUVs_2024-04-04.zip (6.4 MB)

I’m able to load this into UX3D’s dev viewer (http://gltf.ux3d.io). Transforms are incorrect (bug report), but it loads without errors.

However in the latest Babylon.js PR (https://sandbox.babylonjs.com/?snapshot=refs/pull/14945/merge) I get this error:
Unable to load from file:animationPointerUVs.gltf: Invalid property (anisotropyTexture) in property path (anisotropyTexture.wAng)

Should be fixed by Fix khr-animation-pointer with uv transforms by sebavan · Pull Request #14964 · BabylonJS/Babylon.js · GitHub

1 Like

Thank you both for your work on this.

It seems there might be an issue with the transmissionTexture? It is appearing twice in the last two rows of spheres. Is the surface rendering itself into the transmission pass? Although, the thicknessTexture is only rendered once. Hmm.

This is because there is both a thickness and an intensity texture separated but only one is animated.

Thanks. But why are clearcoatTexture.r and clearcoatRoughnessTexture.g treated differently by the renderer? They are setup in a similar manner to transmissionTexture and thicknessTexture, however the clearcoat textures are animated separately, and not duplicated.

Similarly for the other combined textures in my array… occlusionTexture.r/metallicRoughnessTexture.gb, iridescenceTexture.r/iridescenceThicknessTexture.g, sheenColorTexture.rgb/sheenRoughnessTexture.a, specularColorTexture.rgb/specularTexture.a … these are all animated in a similar manner to transmission/roughness, yet they aren’t duplicated?

They are doing the exact same than thickness/intensity only one animate per frame. You can see only one of the channel being animated here:

They should all work in similar way in theory and be animated separately. I am not seeing the one animated together anymore ?

I might also totally misunderstand the issue :slight_smile: so please do not hesitate.

  1. Babylon.js Sandbox - View glTF, glb, obj and babylon files
  2. Drag-n-drop the contents from the last ZIP I shared (animationPointerUVs_2024-04-04.zip)
  3. Examine the column on the far right side, and the last two rows.
  4. Here, I hid the hdrSkyBox node, and set the Scene clear color to white, just to make the thicknessTexture easier to see.

There are secondary appearances of the transmissionTexture (marked in red) which should not be shown. In the upper row of spheres, there are secondary non-animated transmissionTextures. In the lower row, there are secondary animated transmissionTextures.

All the other rows of spheres are rendering properly, without secondary copies.

ohhhhhh I see it now !!! thanks a lot, I will fix it ASAP

1 Like