Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GLTFLoader: Use ImageBitmapLoader in for Safari >= 17. #28560

Merged
merged 1 commit into from
Jun 15, 2024

Conversation

paugit
Copy link
Contributor

@paugit paugit commented Jun 5, 2024

Description

Start using ImageBitmapLoader for Safari >= 17 to fix texture loading in a web worker. Also makes Safari three.js texture loading performance better.

Note

I have only tested this on Safari 17.5 as I don't have older one available. Partial support for CreateImageBitmap in Safari has been around for a longer time but it would be great if someone could make sure that textures still load fine with GLTFLoader when using Safari 17.0. If not, we can change the version limit to 17.5.

The currently used TextureLoader cannot be used in a web-worker and will fail with an error.

@Mugen87
Copy link
Collaborator

Mugen87 commented Jun 10, 2024

@Mugen87 Mugen87 modified the milestone: r166 Jun 10, 2024
@Mugen87
Copy link
Collaborator

Mugen87 commented Jun 10, 2024

I've tested the PR but only with 17.5.

If not, we can change the version limit to 17.5.

If no other dev tests this PR with version 17, let's use 17.5 to be on the safe side.

@donmccurdy
Copy link
Collaborator

I only have access to 17.5 as well, it works there for me. Is it possible to install older Safari versions without reinstalling macOS?

@dghez
Copy link
Contributor

dghez commented Jun 11, 2024

Works on 17.4.1

image

@Mugen87
Copy link
Collaborator

Mugen87 commented Jun 11, 2024

Is it possible to install older Safari versions without reinstalling macOS?

AFAIK, WebKit is separated from Safari and part of macOS so it is available for other apps as well. If you upgrade macOS, you automatically upgrade Safari so it is in sync with the OS's WebKit version. A browser downgrade isn't possible.

Copy link
Collaborator

@Mugen87 Mugen87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably easiest to find out whether this PR works with Safari versions in the range 17.0 - 17.4.1 when we deploy it in production (especially since no one responded here https://x.com/threejs/status/1800474140752896478).

If we encounter any issues, a fix or revert should be easily done.

@Mugen87 Mugen87 changed the title Use ImageBitmapLoader in GLTFLoader for Safari >= 17 GLTFLoader: Use ImageBitmapLoader in for Safari >= 17. Jun 15, 2024
@Mugen87 Mugen87 merged commit abbf28a into mrdoob:dev Jun 15, 2024
11 checks passed
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.

4 participants