How to localize dependencies when loading draco-compressed glb files?

Hello, everyone!
When I try to load a draco-compressed glb file in Babylon by doing something like:

assetsManager.addMeshTask(
“mesh task”,
“”,
“/assets/”,
mysceneDraco.glb
);
assetsManager.load();

I notice a couple of requests in Chrome dev-tools:
image
Everything in the project are localized on my desktop machine except these two files and they are taking quite a while to fetch.

Is it possible to localize these files on my machine, or do I have to request these dependencies remotely?

Do I need to modify something in the Engine or Loader to make this work?

Hope someone can point me to the right direction.

Thanks in advance!

You can adapt the location by modifying the configuration:

BABYLON.DracoCompression.Configuration.decoder = {
wasmUrl: “…/dist/preview%20release/draco_wasm_wrapper_gltf.js”,
wasmBinaryUrl: “…/dist/preview%20release/draco_decoder_gltf.wasm”,
fallbackUrl: “…/dist/preview%20release/draco_decoder_gltf.js”
};

Replace dist/preview with you local location (you can all the files here: Babylon.js/dist/preview release at master · BabylonJS/Babylon.js · GitHub)

2 Likes

@sebavan
Thanks! Solved:grin: