This is just my suggestion for those who might not have tried using ImageBitmap yet.
It appears to have a rather low latency even when creating a new ImageBitmap based CanvasTexture from an existing one that is also using an ImageBitmap.
For a code example you could always check either of the code pages for my GLTF Viewer and GLTF WebGPU viewer, where the scene_bgnd
variable is holding a CanvasTexture with loaded image (or just search through the code for the ImageBitmap
to see all spots where it was used).
Common image formats might be handled as they are, even fetching them directly without using a TextureLoader, while other image formats would need a designated three.js loader and might need some additional manipulation afterwards.
If you would like to do some live testing, use this link to GLTF WebGPU viewer, which can also fall back to using WebGL2 if necessary, and after you load any GLTF model than also try loading locally some background picture (use input marked as BGND
). Once you can see the background image then try using the Y
button to flip the background or the Eq
button to make the background equirectangular. This should show you how fast the loaded image could be manipulated.
None of this is perfect, there might be bugs in my code and the background image might appear flipped when loaded initially.