• Welds Primitives, merging bitwise identical vertices. When merged and indexed, data is shared more efficiently between vertices. File size can be reduced, and the GPU uses the vertex cache more efficiently.


    import { weld, getSceneVertexCount, VertexCountMethod } from '@gltf-transform/functions';
    const scene = document.getDefaultScene();
    const srcVertexCount = getSceneVertexCount(scene, VertexCountMethod.GPU);
    await document.transform(weld());
    const dstVertexCount = getSceneVertexCount(scene, VertexCountMethod.GPU);
Function symbol, where the argument and output are a box labeled 'glTF'.

Made by Don McCurdy. Documentation built with greendoc and published under Creative Commons Attribution 3.0.