jnsmalm / pixi3d

The 3D renderer for PixiJS. Seamless integration with 2D applications.
https://pixi3d.org
MIT License
752 stars 43 forks source link

Support for KHR_mesh_quantization and EXT_meshopt_compression #89

Open goldenratio opened 2 years ago

goldenratio commented 2 years ago

Hi, I am trying to optimize meshes in .glb files using gltfpack, gltfpack -i Soldier.glb -o Soldier-opt.glb -c

Pixi3D doesn't seem to render optimized 3d file. Further googling noticed three.js and playcanvas handles KHR_mesh_quantization and EXT_meshopt_compression

Minimal reproducible repo is here, https://github.com/goldenratio/pixi3d-poc-72 Any help is appreciated. attaching models

jnsmalm commented 2 years ago

Would be nice to support these, but seems like a lot of work to make it happen. I don't feel like digging into this right now, if anyone else does let me know :-)

goldenratio commented 2 years ago

Attaching some additional minimal models AnimatedMorphCube.zip

AnimatedMorphCube.glb (plain) - works well with Pixi3D AnimatedMorphCube-meshquant.glb (KHR_mesh_quantization) - renders, but geometry is bit off AnimatedMorphCube-meshopt.glb (EXT_meshopt_compression) - doesn't render. It needs client-side decoder. It's not a priority.

I will try dig into KHR_mesh_quantization. I suspect something to do with byteStride in gltf-parser

MatsErdkamp commented 3 months ago

Quickly tried to implement meshopt compression by using https://www.npmjs.com/package/meshoptimizer. Got it working for a few meshes, but some were fully bugged out. Will try do add it properly soon.