Common operations on glTF data are implemented by the @gltf-transform/functions module, and are organized in two categories: Transforms and Functions.


npm install --save @gltf-transform/functions


Transforms apply a modification to the Document, and are applied with the Document.transform method. glTF Transform includes many expressive transforms already, and others can be implemented easily using the same APIs.

import { NodeIO } from '@gltf-transform/core';
import { KHRONOS_EXTENSIONS } from '@gltf-transform/extensions';
import { weld, quantize, dedup } from '@gltf-transform/functions';

const io = new NodeIO().registerExtensions(KHRONOS_EXTENSIONS);
const document = await'input.glb');

await document.transform(

	// Custom transform.
	backfaceCulling({cull: true}),

// Custom transform: enable/disable backface culling.
function backfaceCulling(options) {
  return (document) => {
    for (const material of document.getRoot().listMaterials()) {

await io.write('output.glb', document);

For a complete list of available transforms, see the navigation sidebar.


Other functions, like getBounds or compressTexture, are utility functions for general-purpose use. When making changes narrowly to a specific Texture or Material, these offer more targeted alternatives Transforms affecting the entire Document.

For a complete list of available functions, see the navigation sidebar.

Function symbol, where the argument and output are a box labeled 'glTF'.

Made by Don McCurdy Documented with greendoc © 2023 MIT License