zeux / meshoptimizer

Mesh optimization library that makes meshes smaller and faster to render
MIT License
5.49k stars 473 forks source link

gltfpack: Implement EXT_mesh_gpu_instancing support for input scenes #696

Closed zeux closed 3 months ago

zeux commented 3 months ago

When -mi is not specified but the input scene has instancing extension, we convert the instances to the internal world-space transform representation, which can then be serialized using our existing code.

Note that instances are not attached to nodes in the internal representation; animation and scene data is thus silently discarded for now. This is not ideal but is not trivial to change as it would require reworking other parts of the processing pipeline. This also means that the relationship between named nodes and instances isn't preserved, and instances for a given mesh are always concatenated - which is good for efficiency (assuming per instance culling) but may restrict some use cases.

Fixes #685.