Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Samples in the rome-gltf repository can not be displayed due to errors #6432

Open
cx20 opened this issue Apr 8, 2018 · 6 comments
Open

Samples in the rome-gltf repository can not be displayed due to errors #6432

cx20 opened this issue Apr 8, 2018 · 6 comments

Comments

@cx20
Copy link

cx20 commented Apr 8, 2018

I tried to display the following model in Cesium.js.
https://github.com/mrdoob/rome-gltf/blob/master/files/models/life_soup/quadruped_fox.gltf

However, it was not displayed due to an error.
http://jsdo.it/cx20/6z4e

Cesium.js:479 
[Cesium WebGL] Shader program link log: Too many vertex attributes.

Is this due to the limitation of Cesium.js?

@emackey
Copy link
Contributor

emackey commented Apr 8, 2018

First reported in #6416 (comment)

@bagnell
Copy link
Contributor

bagnell commented Apr 9, 2018

I see the same error. That glTF has 22 vertex attributes, but WebGL only supports 16. This is a limitation of WebGL not Cesium. See webglreport.com for how many vertex attributes WebGL supports for you (see Max Vertex Attributes under Vertex Shader on the right).

According to webglstats.com, only a small percentage of hardware supports MAX_VERTEX_ATTRIBS > 16.

@emackey
Copy link
Contributor

emackey commented Apr 9, 2018

I would guess that ThreeJS is just limiting the number, so it doesn't overflow. Not sure if that produces the correct results or not.

@pjcozzi
Copy link
Contributor

pjcozzi commented Apr 9, 2018

@emackey perhaps worth an implementation note in the glTF spec? Could you start a discussion in that repo?

I'm surprised and embarrassed that this hasn't come up before except in the more specific case of skins and morph targets.

@cx20
Copy link
Author

cx20 commented Apr 9, 2018

I tried some other libraries that supports other animations. The link is a link to the sample.
Three.js, Hilo3d, PlayCanvas and the previous version of Babylon.js were able to display animations.

Library rome-gltf animation
three.js
Babylon.js v3.1
Babylon.js v3.2
Cesium.js v1.44
Grimoire.js
ClayGL
Hilo3d
PlayCanvas

@PrincessGod
Copy link

PrincessGod commented May 6, 2018

@emackey @bagnell @pjcozzi @twpayne @cx20 Hi, all~

I found this problem can be optimized.

First decide how many morph targets can be applied according to MAX_VERTEX_ATTRIBS.

Then according to each target's weight to decide use which targets, which means sort by weight and use bigger targets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants