UsdSkel support in USD-wasm - Getting data from HdExtComputation

Hello!

My goal is to add full support for UsdSkel into the Autodesk wasm branch. It appears that SkelAnimations end up in Hydra as SPrims of type extComputation, and during the syncing process some compute shaders are run to calculate what seems to me to be the full transformation matrix that will then be applied to the associated mesh.

I was able to add support for SPrims of type extComputation, in the sense that I see my prims in the wasm side have their dirtyBits set similarly to how they are set when I run usdview locally, and they are being processed during the Sync updates however I have a few questions on how to tie this all together, as now I need to relay the data from the update back to Three.js

  1. I don’t see any compute action happening on the wasm side, since I’m currently trying to get this to work with the ThreeJsRenderDelegate, it would make sense to me that the same Gpu computation that’s happening in usdview wouldn’t happen in the browser, however I see a cpu fallback computation, do I need to build USD in some special way to enable that?
  2. Once I have my HdExtComputation and I’m running the Sync function, is it correct that I’d then pass the computed transformation back to the JS side? And maybe the most important and most basic question but I can’t seem to figure out where that transformation data is. I see a lot of ComputationInputDescriptor and OutputDescriptor and I’m having trouble figuring out where or if there is some ‘currentTransform’ or ‘computationTransform’ or some equivalent

Really appreciate any help and sorry if some of the above is conceptually wrong

Andy

Following up here. I was able to hardcode this in order to try to solve my issue #1 above. Which did not work.

Is this the correct way to try to force CPU fallback computations?

When debugging how HdStorm handles this in usdview when building for macOS, it appears the Hydra Prim that gets generated is a HdStExtComputation (link). Which has it’s own Sync function.

  1. Does it make sense to try to copy the functionality in this Sync function in my own SPrim?
  2. At what point or what information from this Sync function should get pushed out to my render delegate.

Apologies as it feels like there’s some Hydra concept within this problem that just hasn’t clicked for me yet.

Andy

Not sure if this is a great solution but one way I’ve worked around this is by using [UsdSkelBakeSkinning] (Universal Scene Description: API Introduction). which worked for my purposes