• Index Primitives and (optionally) merge similar vertices. When merged and indexed, data is shared more efficiently between vertices. File size can be reduced, and the GPU can sometimes use the vertex cache more efficiently.

    When welding, the 'tolerance' threshold determines which vertices qualify for welding based on distance between the vertices as a fraction of the primitive's bounding box (AABB). For example, tolerance=0.01 welds vertices within +/-1% of the AABB's longest dimension. Other vertex attributes are also compared during welding, with attribute-specific thresholds. For --tolerance=0, geometry is indexed in place, without merging.


    import { weld } from '@gltf-transform/functions';
    await document.transform(
        weld({ tolerance: 0.001 })
Function symbol, where the argument and output are a box labeled 'glTF'.

Made by Don McCurdy Documented with greendoc © 2023 MIT License