uninstance

  • Removes extension EXTMeshGPUInstancing, reversing the effects of the instance transform or similar instancing operations. For each Node associated with an InstancedMesh, the Node's Mesh and InstancedMesh will be detached. In their place, one Node per instance will be attached to the original Node as children, associated with the same Mesh. The extension, EXT_mesh_gpu_instancing, will be removed from the Document.

    In applications that support EXT_mesh_gpu_instancing, removing the extension is likely to substantially increase draw calls and reduce performance. Removing the extension may be helpful for compatibility in applications without such support.

    Example:

    import { uninstance } from '@gltf-transform/functions';
    
    document.getRoot().listNodes(); // → [ Node x 10 ]
    
    await document.transform(uninstance());
    
    document.getRoot().listNodes(); // → [ Node x 1000 ]
    
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.