I’m wondering if there’s a more performant way to take the content of Lottie (canvas player) animation and use it in a Texture. three.js webgl - lottie loader - I get that the performance issue arises from having to read the pixels off the canvas on the CPU and upload it to the GPU, however if I run a video and use VideoTexture (same pixel dimensions as the lottie canvas) then I’m not seeing nearly as big a frame drop - is there some more performant path to the GPU going on with a VideoTexture than what’s possible using HTMLCanvasElement? I tried looking into HTMLCanvasElement.transferToImageBitmap() as I thought that might speed things up, but if it’s at all possible to implement the implementation specifics eludes me.
Hoping someone might have some insight to what’s possible here (if anything at all is possible).
Also, it looks like WebGPU may provide a better path for HTMLCanvasElement (2D) to Texture: WebGPU <img>, <canvas>, and <video> Textures | Toji.dev (see under: " Creating a texture from an HTMLCanvasElement
(<canvas>
tag) or OffscreenCanvas
").