KhronosGroup / glTF-Sample-Viewer

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

Failed to Load glTF-Embedded Model #578

Closed cx20 closed 2 months ago

cx20 commented 2 months ago

I attempted to load some glTF example models using the gltf-viewer on JSFiddle. Below are two examples: one loading a model in standard glTF format and another in glTF-Embedded format.

Works: glTF/Duck.gltf https://jsfiddle.net/cx20/t98a4hxn/12/

Fails: glTF-Embedded/Duck.gltf https://jsfiddle.net/cx20/t98a4hxn/13/

Error:

https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Assets/main/Models/Duck/glTF-Embedded/data:application/octet-stream;base64,ObhEvuo/b7+PUpk+yVSBv...

It appears that loading fails in the glTF-Embedded format due to an incorrect interpretation of the path. Since this uses a Data URI, loading with a relative path should not be necessary.

UX3D-haertl commented 2 months ago

I could reproduce the bug, but FYI: gltf-viewer@1.0.10 is the latest version on npm but we do rolling releases for the sample viewer (with UI) via this repo: https://github.com/KhronosGroup/glTF-Sample-Viewer-Release. Version 1.0.10 is already more than a year old. You will find the current progress in this repo https://github.com/KhronosGroup/glTF-Sample-Renderer which contains only the code for the npm-package (renderer without UI). There is currently no renderer standalone version of the rolling release, so for now one has to build it by themself. If this is wanted for the future, I can look into uploading the npm package to https://github.com/KhronosGroup/glTF-Sample-Viewer-Release as well.

UX3D-haertl commented 2 months ago

We will also release a new npm version in the coming days