UnityGLTF icon indicating copy to clipboard operation
UnityGLTF copied to clipboard

Meshes with over 65000 vertices downloading from web will throw an error

Open NDrexlAxonom opened this issue 8 years ago • 5 comments

We did quite a bit of testing to confirm this, but if a GLTF/GLB downloaded from the web has a mesh that has more than 65000 vertices it will throw a "GLTFHeaderInvalidException: File length does not match chunk header.". If needed I can upload a test model to replicate the issue but I have a feeling it has to do with the 16-bit vertex index buffer. I know Unity 2017.2+ has 32-bit vertex index buffer but I don't know if that has anything to do with this as it could be an exporter issue from the 3d software.

NDrexlAxonom avatar May 16 '18 14:05 NDrexlAxonom

Could you please drop that file (GLB or glTF + bin) into the online validator and check the report?

lexaknyazev avatar May 16 '18 14:05 lexaknyazev

There are no errors reporting through the validator. The glb I am using works in Babylon just fine without any errors but it does not seem to want to import via the unity importer.

NDrexlAxonom avatar May 16 '18 15:05 NDrexlAxonom

GLTFHeaderInvalidException suggests that there's something wrong with the GLB header (which should have nothing to do with the number of vertices, afaiu).

There's also a known issue regarding 65000 limit: https://github.com/KhronosGroup/UnityGLTF/issues/175.

lexaknyazev avatar May 16 '18 15:05 lexaknyazev

Right that is what I thought! But I had our artist split the same mesh up into 4 different submeshes and saved a .glb that way and it loaded into unity just fine (albeit it split it up into 4 different parts). None of the parts are over 65000 verts at all yet the whole thing was just as many verts. I believe unity has an import process to split up the mesh into different submeshes if it exceeds the limit (at least with 16-bit vert buffer) but for gltf/glb it seems we will have to do it which isn't a problem, just wanted to get this out there.

NDrexlAxonom avatar May 16 '18 16:05 NDrexlAxonom

This should be fixed in the latest version of UnityGLTF

ericob avatar Jan 04 '19 22:01 ericob