Closed
Description
As we continue adding pipeline stages, it is going to be important to keep a uniform template for pipeline stage functions so that they can be used in the same way.
I would propose the following:
/**
* Performs some operation on a glTF hierarchy.
*
* @param {Object} gltf An object holding a glTF hierarchy.
* @param {Object} [options] Defines more specific behavior for this stage.
*
* @returns {Promise} A promise that resolves when the stage completes.
*/
function stage(gltf, options) {
...
}
For #130:
I would classify the following as "stages" and should be converted to use this template. Anyone can feel free to do them in any order; it doesn't need to be one big pull request.
- addDefaults
- removeUnused (and all substages of removeUnused)
- mergeDuplicateVertices
- removeUnusedVertices
- mergeDuplicateAccessors
- removeDuplicatePrimitives
- convertDagToTree
- combineMeshes
- cacheOptimization
- quantizedAttributes
- encodeImages