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: Add support for EXT_texture_webp. #20539

Merged
merged 3 commits into from
Oct 27, 2020

Conversation

donmccurdy
Copy link
Collaborator

Adds support for WebP images in glTF models.

https://caniuse.com/webp

@takahirox
Copy link
Collaborator

takahirox commented Oct 21, 2020

I would like to test (and review). Do you or someone else have glTF file including EXT_texture_webp extension?

@donmccurdy
Copy link
Collaborator Author

Sure, here are two examples:

CesiumBoxWebP.zip

  • CesiumBoxWebp.only.glb: Uses only its WebP texture, and fails in browsers that don't support WebP.
  • CesiumBoxWebp.fallback.gltf: Uses PNG fallback for browsers that don't support WebP.

^Ideally the "fallback" PNG would not be bundled in the same file as the WebP texture, so you only have to download one or the other, but this is a quick test. :)

@takahirox
Copy link
Collaborator

Thanks, let me try tomorrow.

BTW, CI test fails but the root issues seem not in this PR but #20540 and #20542.

@mrdoob mrdoob added this to the r122 milestone Oct 21, 2020
@arpu
Copy link

arpu commented Oct 21, 2020

can https://aomediacodec.github.io/av1-avif/ be included in the same way?

@donmccurdy
Copy link
Collaborator Author

I don't think anyone has proposed a third-party extension for AVIF yet. The browser support is pretty limited, as well: https://caniuse.com/avif.

Copy link
Collaborator

@takahirox takahirox left a comment

Choose a reason for hiding this comment

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

I commented two nits, but this change is looking good to me and I confirmed it works on my Windows Chrome and Firefox.

@donmccurdy
Copy link
Collaborator Author

Updated to address feedback, thanks @takahirox and @zeux!

@mrdoob mrdoob merged commit 3926b03 into mrdoob:dev Oct 27, 2020
@mrdoob
Copy link
Owner

mrdoob commented Oct 27, 2020

Thanks!

@Mugen87 Mugen87 mentioned this pull request Oct 27, 2020
@donmccurdy donmccurdy deleted the feat-ext-texture-webp branch October 27, 2020 16:55
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.

6 participants