KhronosGroup / glTF-Sample-Viewer

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

Webp asset spawns errors, occlusion is incorrect #500

Open echadwick-artist opened 7 months ago

echadwick-artist commented 7 months 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 6 months 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 6 months 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