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.
https://sandbox.babylonjs.com/?assetUrl=https://rawcdn.githack.com/KhronosGroup/glTF-Sample-Models/ec880043ae0cead374d7e3a965cc8323c51b06e1/2.0/Triangle/glTF/Triangle.gltf

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.

https://sandbox.babylonjs.com/?assetUrl=https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/Monster/glTF-Binary/Monster.glb

So it must be something to do with rawcdn.githack.com

raw.githubusercontent.com seems to have the same result.

https://sandbox.babylonjs.com/?assetUrl=https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/Triangle/glTF/Triangle.gltf

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
https://rawcdn.githack.com/cx20/gltf-test/797aa3b2f241db6f91423eaf10b4eeb8ad0f255a/examples/babylonjs/index.html?category=tutorialModels&model=Triangle&scale=1&type=glTF

Babylon.js v4.0.0-alpha.29 + Triangle.gltf result: NG
https://rawcdn.githack.com/cx20/gltf-test/266837505ec08134a397670d997c426e303c282e/examples/babylonjs/index.html?category=tutorialModels&model=Triangle&scale=1&type=glTF

@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 https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#scenes

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?
https://sandbox.babylonjs.com/?assetUrl=https://rawcdn.githack.com/KhronosGroup/glTF-Sample-Models/ec880043ae0cead374d7e3a965cc8323c51b06e1/2.0/Triangle/glTF/Triangle.gltf

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.