import {
DRACOLoader,
GLTFLoader,
loadGltf as loadAsync,
} from "node-three-gltf";
import { MeshoptDecoder } from "three-stdlib";
export const loadGltf = async (url: string) => {
const gltf = new GLTFLoader();
const draco = new DRACOLoader();
gltf.setDRACOLoader(draco);
gltf.setMeshoptDecoder(MeshoptDecoder);
return await loadAsync(url);
};
results in
Error: THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files
How can I load compressed gltfs?