Closed mnordine closed 2 years ago
Loading images via an ImageElement, when you're only going to upload as a WebGL texture, is wasteful.
ImageElement
The most efficient way is to use createImageBitmap() and ImageBitmap, where an image is loaded via xhr, and uploading to the GPU without a copy.
createImageBitmap()
ImageBitmap
See https://developer.mozilla.org/en-US/docs/Web/API/createImageBitmap and https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap
Loading images via an
ImageElement
, when you're only going to upload as a WebGL texture, is wasteful.The most efficient way is to use
createImageBitmap()
andImageBitmap
, where an image is loaded via xhr, and uploading to the GPU without a copy.See https://developer.mozilla.org/en-US/docs/Web/API/createImageBitmap and https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap