Skip to content

GLTFMeshOptDecodePlugin

ExampleSource CodeAPI Reference

Loads the MeshOpt Decoder module from meshoptimizer library at runtime from a customisable cdn url. The loaded module is set in window.MeshoptDecoder and then used by GLTFLoader2 to decode files using EXT_meshopt_compression extension

typescript
import {GLTFMeshOptDecodePlugin} from 'threepipe'
const plugin = viewer.addPluginSync(new GLTFMeshOptDecodePlugin())
// await plugin.initialize() // optional, this happens when loading a gltf file with extension anyway

const texture = await viewer.load('file.glb')

ThreePipe - Make 3D applications on the web