glTFast icon indicating copy to clipboard operation
glTFast copied to clipboard

Extension KHR_animation_pointer

Open ghost opened this issue 1 year ago • 8 comments

Add support for the upcoming extension KHR_animation_pointer.

ghost avatar Mar 29 '23 14:03 ghost

Just to note, I have begun working on an import implementation of this and have successfully animated the material base color property with KHR_animation_pointer. Thanks @hybridherbst for the great test asset!

https://user-images.githubusercontent.com/9121007/230140933-ceee1ef7-71ea-4237-81b0-bc11cf13c6af.mp4

mikeskydev avatar Apr 05 '23 15:04 mikeskydev

Excellent! There's a few more sample assets, and you can always make your own by simply exporting with our UnityGltf fork at https://github.com/prefrontalcortex/unitygltf/tree/dev :)

Excited to see this come to glTFast!

hybridherbst avatar Apr 06 '23 09:04 hybridherbst

@mikeskydev this is really fantastic, definitely really interested about this work !

Having at least base color + transparency support will definitely cover the core baseline of most of standard DCC (or CAD) tools. I I would love to see a PR when you are further along the line.

When you say import, I suppose you also mean runtime loading and not just editor import ?

ptc-rgrasset avatar Apr 07 '23 17:04 ptc-rgrasset

Thanks! I hope to bring a draft PR this week to see if I'm going along the right lines. I'll use this issue to document my progress before the PR:

So far I've implemented baseColorFactor which as you said covers a lot of cases. I've also started implementing KHR_texture_transform as required by my client, but as some initial logic in glTFast sets up texture transforms in C#, I may need to move the logic to the shaders instead otherwise the transforms are wrong.

Due to the way Unity's animation system works, I've also got a basic reverse material lookup just to get up to speed, but I want to improve that before a PR.

I've also observed that animating material color only works on Legacy animations, I'm not familiar enough with Mechanim to know if I'm doing something wrong or it (still) isn't supported there.

mikeskydev avatar Apr 08 '23 18:04 mikeskydev

https://user-images.githubusercontent.com/9121007/231744054-6a46098f-2293-4292-b7a7-92be21d094cd.mp4

This should be all the animatable material properties that glTFast currently supports!

I'm going to do a bit more tidying up, then will submit a draft PR for some feedback.

mikeskydev avatar Apr 13 '23 11:04 mikeskydev

Nice! It does seem like the core animation capabilities have been lost from your video, e.g. blend shape weights, transforms.

hybridherbst avatar Apr 13 '23 12:04 hybridherbst

Yep, I was focusing on material pointers first but will attach the node pointers to the old routes in due course!

mikeskydev avatar Apr 13 '23 13:04 mikeskydev

Fairly happy with this now, would love some feedback! https://github.com/Unity-Technologies/com.unity.cloud.gltfast/pull/7

mikeskydev avatar Apr 20 '23 15:04 mikeskydev

Thanks a lot! Looking at it in https://github.com/Unity-Technologies/com.unity.cloud.gltfast/pull/7

atteneder avatar Jun 18 '24 09:06 atteneder