Triangle.gltf does not displayed in Babylon JS Sandbox

I tried to display the following models with Babylon JS Sandbox (v4.0.0-alpha.29).

However, it seems that nothing is displayed on the screen.

I do not remember the exact version, but I think that it was able to be displayed about a month ago.

Pinging @bghgary

It seems to work with the right url.

So it must be something to do with seems to have the same result.

Perhaps, this problem seems to depend on the model.

I compared the display results of Triangle.gltf with v4.0.0-alpha.25 and 29.

Babylon.js v4.0.0-alpha.25 + Triangle.gltf result: OK

Babylon.js v4.0.0-alpha.29 + Triangle.gltf result: NG

@bghgary I think the fix between alpha.26 and 27 is affected.

The reason for this is that Triangle.gltf will be displayed when you restore the modification part.

Load nothing instead of error if scene is undefined

The model which can not be displayed seemed to be a model without default scene.
There is no default scene in Triangle.gltf which is the minimum sample of glTF Tutorial.
Is it the intended behavior that Triangle.gltf does not appear on the BabylonJS Sandbox?

Yes. This is the expected behavior. It was incorrect before. See glTF/ at master · KhronosGroup/glTF · GitHub

When scene is undefined, runtime is not required to render anything at load time.

I understood that it was the expected behavior.
However, it is a little doubtful whether it is appropriate behavior.
I have found similar discussions in the past.

Handling multiple scenes without a default scene #815

I think the following behavior is desirable as a viewer.

  • if there’s no scene , then scenes[0] is selected.

Otherwise, I think that features should be provided that can be selected from multiple scenes.

Towards the end of the thread, it ended with the language I quoted in the spec. If you feel strongly about the spec, please submit an issue to the glTF GitHub.

I made this change because of glTF: files with no scenes give "/scene: Failed to find index (0)" · Issue #5900 · BabylonJS/Babylon.js · GitHub, but I can modify the code such that:

  1. /scene is not defined and /scenes is empty, then load nothing
  2. /scene is not defined and /scenes is not empty, then load the first scene.

That will satisfy both issue 5900 and this issue.

1 Like

Thank you for considering.

  1. /scene is not defined and /scenes is empty, then load nothing
  2. /scene is not defined and /scenes is not empty, then load the first scene.

I think that behavior is user-friendly as a viewer.

PR: Fix for default scene loading in glTF loader by bghgary · Pull Request #5998 · BabylonJS/Babylon.js · GitHub

@cx20 Thanks for bringing this up!

1 Like

Thank you for fixing. I confirmed that it has been fixed by alpha30.

BTW, I think that it is another problem, but when trying to display Triangle.gltf it seems that a shader error is output to the console. Could you confirm it?

1 Like

cc @sebavan

Update pbrBRDFFunctions.fx · BabylonJS/Babylon.js@e8a329c · GitHub fixes it. it will be in the next nightly, thanks for reporting it.

1 Like

Thank you for your fixing. I confirmed that the shader error was resolved in the updated version of alpha30.