yoga
yoga copied to clipboard
Optimize outputted meshes with meshoptimizer
Looking at zeux/meshoptimizer, we could use some optimization to assimp output geometries.
First do some tests with outputted geometries by YOGA, count the gains, and see if an integration as a lib is doable.
TODO-list:
- [ ] Test gltf optimizer with multiple geometries, measure the gains if any
- [ ] See if it is usable as a library to add to YOGA (python bindings)
- [ ] Write python bindings
- [ ] Integrate to YOGA (and option to deactivate those optimizations ?)
I've tested a input model with 942
vertices and 1560 triangles (FBX format).
The output of YOGA is a GLTF file with a 4680
vertices and 1560 triangles model.
Then I used gltfpack on this last model, turned into a 1187
vertices and 1560 triangles model.
Triangles count is preserved across the different files, but the original fbx still have the lower vertex count. Well the optimized gltf have reduced to 25% the vertex count of the yoga output one.
I tried a simple cube: original have 8
vertices and 12 triangles.
exported with YOGA, I get 36
vertices and 12 triangles.
gltfpack gives 24
vertices and 12 triangles.
It looks like there should be some fixes to do in assimp too... But that's another topic.
In terms of vertices optimization, results are looking good. What do you think @flozz ?