donmccurdy / glTF-Transform

glTF 2.0 SDK for JavaScript and TypeScript, on Web and Node.js.
https://gltf-transform.dev
MIT License
1.43k stars 150 forks source link

Simplify Draco and Meshopt compression implementations #1386

Open donmccurdy opened 6 months ago

donmccurdy commented 6 months ago

Meshopt

Currently glTF Transform's Meshopt implementation has its own accessor writing method, and doesn't support VertexLayout options. I think possibly glTF Transform could just write Meshopt-compatible buffer view layouts by default, and simplify the Meshopt implementation accordingly.


Draco

The Draco implementation currently has to duplicate accessors in rare situations, leading to complex bugs. It may be worth a change to require pre-processing with draco(), and failing if Draco compression is attempted when that pre-processing has not been applied. Or other simplifications may be possible.