convertToUnIndexedMesh Bug when VertexBuffer.type is not float

I have a gltf file , it can be correctly loaded by gltf-loader.

After PrepareMeshForTrianglesAndVerticesMode, it is disappeared and some Console throw some gl error.

I print VertexBuffer after PrepareMeshForTrianglesAndVerticesMode, most of values in buffer are NaN

I review code of PrepareMeshForTrianglesAndVerticesMode, I find stride number is too big and index are out of range (no error , value is set with NaN).
I replace vertexBuffer.getStrideSize() with (vertexBuffer as any)._size, it work again.

Would be great if you could share a repro ?

Adding @bghgary in case it raises a flag

1 Like

I think these two numbers (getStrideSize() and _size) should be the same for a glTF. A repro would be really useful.

1 Like

Here is the error gltf file, you can load and use PrepareMeshForTrianglesAndVerticesMode for it to repro this issuse (1).gltf
@bghgary @sebavan

This file’s position/uv/normal are float64Array, their byte stride are 32 (3 * 4 / 3 * 8) . float32array’s stride should be 16 (3 * 4/3 * 4)
they use this way to get floatData:

There’s a bug in _convertToUnIndexedMesh indeed, here’s the fix: