Keep index and KHR_mesh_quantization attributes on GLB export

OS: Windows 10 x64
Browser: ungoogled-chromium 108.0.5359.95
Babylon.js: 5.38.0
Playground: Babylon.js Playground

Exported GLB should contains the original index and attribute buffer.

index changed on export, expected: Uint16Array actual: Uint32Array
index byteLength changed on export, expected: 6 actual: 12
position type changed on export, expected: 5123 actual: 5126
position size changed on export, expected: 6 actual: 12

As I can see it, KHR_mesh_quantization is currently not supported by the glTF exporter.

cc @bghgary who will know more (but be patient as he is currently in vacation).

1 Like

Right, KHR_mesh_quantization is not currently supported, but it should be easy to add. Would anyone want to contribute a fix?

After checking with @bghgary, it is actually not straightforward at all to add.

We won’t do it for the version 6.x but are fully open to contribution if you need this pretty soon ? Otherwise, we will wait for more request from the community to prioritize it.

As a crappy workaround, after serializing to a GLB from Babylon.js, put the GLB through something like glTF-Transform to convert the data back.

1 Like