mgsx-dev/gdx-gltf

GLTF extensions: KHR_mesh_quantization

Opened this issue · 0 comments

Would be a great help if KHR_mesh_quantization is implemented in gdx-gltf.

To take full advantage of gltfpack from MeshOptimizer library you need KHR_mesh_quantization. Also EXT_mesh_gpu_instancing extention support would be helpful.

Exception when trying to use optimized gltf files:

Exception in thread "main" net.mgsx.gltf.loaders.exceptions.GLTFUnsupportedException: Extension KHR_mesh_quantization required but not supported
	at net.mgsx.gltf.loaders.shared.GLTFLoaderBase.load(GLTFLoaderBase.java:103)
	at net.mgsx.gltf.loaders.gltf.GLTFLoader.load(GLTFLoader.java:16)
	at net.mgsx.gltf.loaders.gltf.GLTFLoader.load(GLTFLoader.java:11)
	at com.monstrous.duckfield.Main.create(Main.java:169)

From gltfpack docs:

gltfpack substantially changes the glTF data by optimizing the meshes for vertex fetch and transform cache, quantizing the geometry to reduce the memory consumption and size, merging meshes to reduce the draw call count, quantizing and resampling animations to reduce animation size and simplify playback, and pruning the node tree by removing or collapsing redundant nodes. It will also simplify the meshes when requested to do so.

By default gltfpack outputs regular .glb/.gltf files that have been optimized for GPU consumption using various cache optimizers and quantization. These files can be loaded by GLTF loaders that support KHR_mesh_quantization extension such as three.js (r111+) and Babylon.js (4.1+).