How to use blob images as texture

URL.createObjectURL returns a url string not the images, a url to access/load the file like a external resource, you can use this URL with texture loader or in case of a image:

const image = new Image;
image.src = URL.createObjectURL(fileBlob);

Also loading resources is always asynchronous there isn’t really a point in doing this in a worker unless you’re processing/decoding something. If you experience laggs on the main thread it’s likely a different reason like the upload of large textures or textures not in size power of 2 causing a resize before upload.

1 Like