KhronosGroup / glTF-Sample-Viewer

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

Validation inconsistency between Viewer and Validator #527

Closed JCash closed 3 months ago

JCash commented 11 months ago

The validator reports an error on this example file, but the viewer accepts it without any issue.

I feel like this is a slippery slope when it comes to the standard of glTF format. If tools have to make unspecified changes in order to show a broken file, then we'll have huge problems in finding tools that work well together, which defeats the purpose imho.

E.g. I use this library to load files: https://github.com/jkuhlmann/cgltf It's well used library.

The https://github.khronos.org/glTF-Validator/ tool reports the error "message": "Node 1 is not a root node."

The https://github.khronos.org/glTF-Sample-Viewer-Release/ simply seem to patch the file and shows it. It doesn't notify the user that the file is invalid.

babylon.js also patches the file, but also shows the error.

So, which is correct? The Validator or the Viewer?

Here is the model in question: model.zip

donmccurdy commented 10 months ago

Viewers like those of babylon.js or three.js generally try to show the file as quickly as possible, and won't run into every issue that the glTF Validator can find. Running the "glTF Validator" suite would typically happen in parallel, if it's run at all, and could be shown as a visual warning. I agree it'd be a nice addition if this viewer could run the validation suite and display those results as well.

UX3D-haertl commented 7 months ago

Adding glTF-Validator support is planned and will be added soon