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

Multiple meshes - No indices #694

Closed
benjaminabb opened this issue Aug 25, 2016 · 4 comments
Closed

Multiple meshes - No indices #694

benjaminabb opened this issue Aug 25, 2016 · 4 comments

Comments

@benjaminabb
Copy link

When using flatshading for all meshes, vertices have to be duplicated with one normal for each face. Then having indices doesn't make sense anymore, because it increases the file size.
But storing multiple meshes in one glTF without indices results in an error. Only one mesh shows up. While debugging Cesium, I can see that multiple meshes are loaded and this error message occurs while rendering:

[.CommandBufferContext]GL ERROR :GL_INVALID_OPERATION : glDrawArrays: attempt to access out of range vertices in attribute 1

When debugging Cesium in Context.js line 934 [context._gl.drawArrays(primitiveType, offset, count);] a different offset is used than defined in the glTF file.
In the example three Cubes are saved, but when loading the file only the first one is rendered.
Is this not possible in glTF or is it not implemented in Cesium? Or did I write the glTF wrong?

testMulti.zip

@javagl
Copy link
Contributor

javagl commented Aug 25, 2016

Just minor remarks:

  • The input passes the validation
  • It can be rendered properly with other viewers

Unrelated detail: I wonder how the accessor.min and accessor.max are computed. The position data contained in the accessors describes perfect cubes, but accessor.min seems to be off by some epsilon (1.999999 and -1.000001), although these values should be representable as IEEE754 floats. Similarly, for the normals.

@benjaminabb
Copy link
Author

Thank you for testing it. I double checked it with the three.js loader and it didn't work, but maybe the loader doesn't support non indexed models at all.
So is this just a Cesium issue?

The slightly off positions and the resulting normals came from Blender or the export plugin for Blender. I fixed the input by hand and now the results are a bit nicer.
testMulti.zip

@pjcozzi
Copy link
Member

pjcozzi commented Aug 29, 2016

There's a decent chance that this is a bug in Cesium, let's keep this issue open until CesiumGS/cesium#4237 is investigated.

@pjcozzi
Copy link
Member

pjcozzi commented Jul 16, 2017

CesiumGS/cesium#4237 is fixed.

@pjcozzi pjcozzi closed this as completed Jul 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants