KhronosGroup / glTF-Sample-Viewer

Physically-Based Rendering in glTF 2.0 using WebGL
Apache License 2.0
1.29k stars 238 forks source link

EXT_texture_webp, a ratified extension, is not supported yet #500

Closed echadwick-artist closed 4 months ago

echadwick-artist commented 1 year ago
  1. https://github.khronos.org/glTF-Sample-Viewer-Release/
  2. Model = GlassBrokenWindow

Result: no errors. This is as expected.

  1. Unzip the attached asset, and drag-and-drop the GLB into the viewer.

Result: Two problems: a) Error message "Image is undefined for texture undefined", which appears on load, and every time model is moved. b) Occlusion debug view shows incorrect texture.

2023-10-09 11_32_48-glTF Sample Viewer

glTF Validator reports no problems for the GLB with webp textures.

GlassBrokenWindow_webp.zip

Thanks for looking into this! Eric

jim-ec commented 1 year ago

The sample viewer does not support decoding WebP images. While the spec only allows image/jpeg and image/png as image mime types, the schema does not enforce any specific mime type, which is maybe why the validator does not complain.

echadwick-artist commented 1 year ago

Ah, thanks.

It seems to me the sample viewer should support all ratified extensions.

This asset uses the last one on the list, EXT_texture_webp

emackey commented 6 months ago

The error message is better now, but WebP was ratified some time ago. It should be supported here.

screenshot