# Use Tools LoadFile loads multiple glb models with texture disorder

**URL:** https://forum.babylonjs.com/t/use-tools-loadfile-loads-multiple-glb-models-with-texture-disorder/53320
**Category:** Questions
**Tags:** texture
**Created:** [September 10, 2024, 6:43am UTC](https://forum.babylonjs.com/t/use-tools-loadfile-loads-multiple-glb-models-with-texture-disorder/53320 "2024-09-10T06:43:49Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![1114257133](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/1114257133/32/46709_2.png) [@1114257133](https://forum.babylonjs.com/u/1114257133)
#### Post date: [September 10, 2024, 6:43am UTC](https://forum.babylonjs.com/t/use-tools-loadfile-loads-multiple-glb-models-with-texture-disorder/53320/1 "2024-09-10T06:43:49Z")

</div>

I use Tools LoadFile to load glb, which retrieves the buffer from the callback and then uses IndexDB or other storage to store the buffer. I found that even when loading a large number of glb files for the first time, there is still a problem of texture distortion. I found that the material parsed by each buffer is correct, but the texture may be from another model

```auto
	_load(scene: Scene, option: any) {
		const { id, projectId, url, name, fileName, position } = option;
		Tools.LoadFile(
			url,
			buf => {
				SceneLoader.ImportMesh(
					undefined,
					'',
					new Uint8Array(buf as ArrayBuffer),
					scene,
					(meshes, particleSystems, skeletons, animationGroups, transformNodes, geometries, lights) => {
						console.log('result::', meshes, transformNodes);

						meshes[0].id = projectId || id;
						meshes[0].position.fromArray(position);
						meshes[0].name = name;

						return {
							meshes,
							particleSystems,
							skeletons,
							animationGroups,
							transformNodes,
							geometries,
							lights,
						};
					},
					progress => {
						console.log('load progress', progress);
					},
					error => {
						console.log('load error::', error);
					},
					'.glb',
				);
			},
			undefined,
			undefined,
			true,
		);
	}

```

Using my method to load more than one model simultaneously externally will result in texture distortion issues

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/a/b/abddcfc5e6e334b5884589e7fdf7e2f108df6ce8.jpeg)

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/3/5/35359251baef475c01f8f3f0df13c6223472449d.jpeg)  
I try to retrieve the buffer synchronously or asynchronously, but this situation occurs

---

<div class="post-metadata">

### Author: ![srzerbetto](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/srzerbetto/32/20941_2.png) [@srzerbetto](https://forum.babylonjs.com/u/srzerbetto)
#### Post date: [September 10, 2024, 11:53am UTC](https://forum.babylonjs.com/t/use-tools-loadfile-loads-multiple-glb-models-with-texture-disorder/53320/2 "2024-09-10T11:53:03Z")

</div>

Hello @1114257133 , how are you doing?

We had this issue at some point when loading models using Arrays, but it got solved at some point. Can you tell which version of Babylon.js you are using?

---

<div class="post-metadata">

### Author: ![1114257133](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/1114257133/32/46709_2.png) [@1114257133](https://forum.babylonjs.com/u/1114257133)
#### Post date: [September 13, 2024, 8:49am UTC](https://forum.babylonjs.com/t/use-tools-loadfile-loads-multiple-glb-models-with-texture-disorder/53320/3 "2024-09-13T08:49:37Z")

</div>

![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/e/b/ebdd27d7b7317f2147c258cd83873ce28d4c4f82.png)  
Boss, which version are you using?

---

<div class="post-metadata">

### Author: ![srzerbetto](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/srzerbetto/32/20941_2.png) [@srzerbetto](https://forum.babylonjs.com/u/srzerbetto)
#### Post date: [September 13, 2024, 11:30am UTC](https://forum.babylonjs.com/t/use-tools-loadfile-loads-multiple-glb-models-with-texture-disorder/53320/4 "2024-09-13T11:30:06Z")

</div>

That’s a little old, if you want to stay using version 6 I think this issue should be fixed in version 6.49.0, but I would recommend updating to the latest version (7.25.1).
