Open takahirox opened 5 years ago
So ImageBitmap created with different options parameters should be distinguished from others even if they refer to the same url.
TBH, this use case sounds a bit artificial to me. Why would you load the same texture twice with different image bitmap settings? Properties like premultiplyAlpha
or colorSpaceConversion
highly depend on the used image. It's seems unlikely to extract the same image data in different ways...
Yeah, may be rare case. But it's a bug. Probably accepting it as limitation and documenting may sound reasonable.
Description of the problem
Background
ImageBitmap
is created withcreateImageBitmap()
.createImageBitmap()
can take optionsimageOrientation(flipY)
,premultiplyAlpha
, and so on. The options have effect to bitmap.https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/createImageBitmap
So
ImageBitmap
s created with different options parameters should be distinguished from each other even if they refer to the same url.Problem
But
Cache
system inImageBitmapLoader
uses only url as cache key.https://github.com/mrdoob/three.js/blob/dev/src/loaders/ImageBitmapLoader.js#L50 https://github.com/mrdoob/three.js/blob/dev/src/loaders/ImageBitmapLoader.js#L87
In the example below,
bitmap
should be distinguished frombitmap2
but identical ifCache
is enabled.Three.js version
Browser
OS
Hardware Requirements (graphics card, VR Device, ...)