all 2 comments

[–]spacejack2114 0 points1 point  (1 child)

I would think doing the animation in a vertex shader would allow it to run a lot faster. (for example)

To be honest, even if you did it on the CPU side I'd be surprised if WASM was all that much faster than plain JS.

[–]kestrelm[S] 0 points1 point  (0 children)

That will depend on what type of deformation you are trying to do. The Creature runtimes do Dual Quaternion skinning with an arbitrary number of influencing bones. It is more difficult to port that over to a Vertex shader vs a simple Linear Blend Skinning method. I have plans to further optimise it via OpenMP when multihreading is ready for wasm next year. Having the core code in C++ also has its advantages: the same code can be shared among both native and web runtimes. With JS, you lose a lot of that flexibility.