Skip to content

Conversation

@donmccurdy
Copy link
Collaborator

Related:

Provides an option to disable use of createImageBitmap in GLTFLoader. Intended as a workaround at least until upstream issues in Safari (https://bugs.webkit.org/show_bug.cgi?id=232357) are fixed.

/cc @takahirox

@takahirox
Copy link
Collaborator

Personally I like this idea.

@elalish
Copy link
Contributor

elalish commented Dec 7, 2021

Sounds good, now I just need to remind myself to disable it once r136 comes out.

@dbuck
Copy link
Contributor

dbuck commented Dec 16, 2021

🤔 Maybe a hint:

I'm not as familiar with the THREE.ImageBitmapLoader, but @lojjic resolved a similar safari 15 black texture issue for us with our custom ImageBitmapLoader by calling ImageBitmap.close() after we used it in our texSubImage2D call when uploading a partial tile to an existing texture or alongside the normal texture.dispose().

    texture.dispose();
    texture.images?.forEach((image: HTMLImageElement | ImageBitmap) => {
      (image as ImageBitmap).close?.();
    });

After those changes we've been able to re-enable ImageBitmap on ios15 and have not heard any problem reports yet in a fairly large number of views?

@donmccurdy
Copy link
Collaborator Author

I'm afraid we can't do that by default (see #22652 (comment)) but it's a good workaround for many use cases.

@mrdoob
Copy link
Owner

mrdoob commented Dec 21, 2021

I would not create more API for this...

I think for the time being I would just check for /Firefox|Safari/.test( navigator.userAgent ) === false here:

if ( typeof createImageBitmap !== 'undefined' && /Firefox/.test( navigator.userAgent ) === false ) {

Seems like calling .close() is the right solution, but in order to do that we first need #22846.

@mrdoob mrdoob added this to the r136 milestone Dec 21, 2021
@mrdoob mrdoob closed this Dec 24, 2021
@mrdoob
Copy link
Owner

mrdoob commented Dec 24, 2021

Sorry for rejecting 😕

@mrdoob mrdoob deleted the feat-gltfloader-imagebitmap-optout branch December 24, 2021 16:57
@mrdoob mrdoob removed this from the r136 milestone Dec 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants