How to use draco loader?

See the GLTFLoader docs here: https://threejs.org/docs/#examples/loaders/GLTFLoader. Draco is a compression method that can be used inside of glTF files. To do this you have to give the GLTFLoader a DRACOLoader instance:

var loader = new THREE.GLTFLoader();

// Optional: Provide a DRACOLoader instance to decode compressed mesh data
THREE.DRACOLoader.setDecoderPath( '/examples/js/libs/draco' );
loader.setDRACOLoader( new THREE.DRACOLoader() );

The decoders are found in the gltf/ folder here: https://github.com/mrdoob/three.js/tree/dev/examples/js/libs/draco

1 Like