AnalyticalGraphicsInc / gltf-vscode

This is an extension for Visual Studio Code to add support for editing glTF files.
Apache License 2.0
460 stars 63 forks source link

alien.glb causes Cesium viewer RuntimeError: Vertex shader failed to compile. #74

Closed najadojo closed 6 years ago

najadojo commented 7 years ago

Import GLB https://github.com/BabylonJS/Website/blob/master/Assets/Alien.glb Load preview Switch to Cesium viewer.

Expected model loads.

Actual error message:

Uncaught RuntimeError: Vertex shader failed to compile.  Compile log: ERROR: 0:5: '' : array size must be greater than zero

Error
    at new t (file:///C:/Users/xx/.vscode/extensions/cesium.gltf-vscode-2.1.2/engines/Cesium/Cesium.js:477:4655)
    at f (file:///C:/Users/xx/.vscode/extensions/cesium.gltf-vscode-2.1.2/engines/Cesium/Cesium.js:502:8256)
    at y (file:///C:/Users/xx/.vscode/extensions/cesium.gltf-vscode-2.1.2/engines/Cesium/Cesium.js:502:10306)
    at d.get (file:///C:/Users/xx/.vscode/extensions/cesium.gltf-vscode-2.1.2/engines/Cesium/Cesium.js:502:11071)
    at ht (file:///C:/Users/xx/.vscode/extensions/cesium.gltf-vscode-2.1.2/engines/Cesium/Cesium.js:519:1591)
    at vt (file:///C:/Users/xx/.vscode/extensions/cesium.gltf-vscode-2.1.2/engines/Cesium/Cesium.js:519:3998)
    at Xt (file:///C:/Users/xx/.vscode/extensions/cesium.gltf-vscode-2.1.2/engines/Cesium/Cesium.js:519:13479)
    at Te.update (file:///C:/Users/xx/.vscode/extensions/cesium.gltf-vscode-2.1.2/engines/Cesium/Cesium.js:520:2264)
    at a.update (file:///C:/Users/xx/.vscode/extensions/cesium.gltf-vscode-2.1.2/engines/Cesium/Cesium.js:541:31068)
    at $e (file:///C:/Users/xx/.vscode/extensions/cesium.gltf-vscode-2.1.2/engines/Cesium/Cesium.js:545:13255)
emackey commented 7 years ago

Not sure if it's related, but that model produces a ton of validation errors.

emackey commented 6 years ago

Validation errors should go away with the next release. https://github.com/KhronosGroup/glTF-Validator/issues/70

I haven't had a chance yet to debug further into the Cesium side of this issue.

emackey commented 6 years ago

So the old validation messages went away, but a new warning has shown up for each of the nodes:

Node uses skinned mesh, but has no skin defined.

emackey commented 6 years ago

@lexaknyazev or @donmccurdy or anyone else: Is there defined behavior when "Node uses skinned mesh, but has no skin defined" ? I presume Cesium should do something better than produce invalid GLSL code. What's supposed to happen when the skin is unspecified?

lexaknyazev commented 6 years ago

I'd say that an engine could just ignore presence of joints/weights vertex attributes because there's no way to use them without skeleton (failure is also an option).

donmccurdy commented 6 years ago

three.js will just load the mesh as a THREE.Mesh instead of THREE.SkinnedMesh, with the joint/weight attributes passed through but unused, although that wasn't particularly a deliberate choice.

emackey commented 6 years ago

Thanks all. This is fixed in Cesium and published with gltf-vscode version 2.1.12.