From 786dfa5ecffac95c95624711f6b07292be0fb35b Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Tue, 19 May 2026 14:37:20 +0200 Subject: [PATCH] Add Meshopt decoding support to GLTF loader --- src/assets/gltf-model-import.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/assets/gltf-model-import.ts b/src/assets/gltf-model-import.ts index ed60128a..2cbcccdc 100644 --- a/src/assets/gltf-model-import.ts +++ b/src/assets/gltf-model-import.ts @@ -13,6 +13,7 @@ import { GLTFLoader, type GLTF } from "three/examples/jsm/loaders/GLTFLoader.js"; +import { MeshoptDecoder } from "three/examples/jsm/libs/meshopt_decoder.module.js"; import { clone as cloneSkeleton } from "three/examples/jsm/utils/SkeletonUtils.js"; import { createModelInstance, type ModelInstance } from "./model-instances"; @@ -512,6 +513,7 @@ export function createConfiguredGltfLoader( ): GLTFLoader { const loader = new GLTFLoader(); loader.setDRACOLoader(getSharedDracoLoader()); + loader.setMeshoptDecoder(MeshoptDecoder); const ktx2Mode = options.ktx2 ?? "if-initialized"; const ktx2Loader =