I’ve to load a glb file which has some external assets in the form of .png .
const loadingManager = new LoadingManager();
loadingManager.onProgress = (url, itemsload, itemstotal) => {
console.log(`start loading : ${url}`)
}
loadingManager.addHandler( /\.png$/i, new TextureLoader());
loadingManager.onLoad = function ( ) {
progressBarContainer.style.display = "none";
controls.style.display = "block";
};
const loader = new GLTFLoader(loadingManager);
const dracoLoader = new DRACOLoader();
dracoLoader.setDecoderPath('https://www.gstatic.com/draco/v1/decoders/');
loader.setDRACOLoader(dracoLoader);
loader.setResourcePath("public/assets/safari/")
const carData = await loader.loadAsync('public/assets/safari/model.glb');
the thing is i don’t know how to map those textures to my materials.
since there are so many i can’t do it manually.
this is my console, and there are some blob requests. the extenal files are saved in the same directory as those of glb file.