Creates GPU instances (with EXT_mesh_gpu_instancing
) for shared Mesh references. In
engines supporting the extension, reused Meshes will be drawn with GPU instancing, greatly
reducing draw calls and improving performance in many cases. If you're not sure that identical
Meshes share vertex data and materials ("linked duplicates"), run dedup first to link them.
Example:
import { dedup, instance } from '@gltf-transform/functions';
await document.transform(
dedup(),
instance({min: 2}),
);
Made by Don McCurdy • Documented with greendoc • © 2023 MIT License
instance