gltf-transform-atlas
v0.1.0
Published
GLTF transform function to create texture atlasses
Readme
GLTF transform texture atlas
Browser only compatible @gltf-transform/core function to create texture atlasses (best effor to keep the models unchanged)
Installation
npm i gltf-transform-atlasUsage
import { dedup, flatten, join, prune } from '@gltf-transform/functions';
import { createTextureAtlas } from "gltf-transform-atlas"
/**
* Example optimization pipeline implemented with the glTF Transform API + atlas compression
* See https://gltf-transform.dev/ for full functionality.
*/
await document.transform(
flatten(),
createTextureAtlas({
atlasSize: 2048,
textureBorder: 16,
}),
dedup(), /* These functions after the atlas are important to lower draw calls, as the atlasser just join textures and materials, but do not join them automatically */
prune(),
join({ keepNamed: false })
);