# Problem with loading textures

**URL:** <https://discourse.threejs.org/t/problem-with-loading-textures/15602>\
**Category:** Questions\
**Tags:** obj-loader, mtl-loader, textures\
**Created:** [May 27, 2020, 7:35am UTC](https://discourse.threejs.org/t/problem-with-loading-textures/15602 "2020-05-27T07:35:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheNikCD](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/thenikcd/32/11069_2.png) [@TheNikCD](https://discourse.threejs.org/u/TheNikCD)\
**Post date:** [May 27, 2020, 7:35am UTC](https://discourse.threejs.org/t/problem-with-loading-textures/15602/1 "2020-05-27T07:35:30Z")

</div>

I load project by using .obj and .mtl files. Also have images. When I open page textures not loads.

 ![Screenshot_12](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/2X/0/07111f6f157262cdc94cd61624da5aa2613aef4b.png)  
But it looks like:  
 ![image_2020-05-27_10-37-28](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/2X/a/a549173d22a2a9ff11302e1d61ef14707d8f7b0a.png)  
Code with load files:

```
            var manager = new THREE.LoadingManager();
            manager.addHandler( /\.dds$/i, new DDSLoader() );

            new MTLLoader( manager )
                .setPath( 'obj/city/' )
                .load( '1-12.mtl', function ( materials ) {
                    materials.preload();
                    new OBJLoader( manager )
                        .setMaterials( materials )
                        .setPath( 'obj/city/' )
                        .load( '1-12.obj', function ( object ) {
                            object.position.y = - 95;
                            scene.add( object );
                        });
                } );
```

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [May 27, 2020, 7:46am UTC](https://discourse.threejs.org/t/problem-with-loading-textures/15602/2 "2020-05-27T07:46:00Z")

</div>

Can you please share the OBJ and MTL file in this thread?

Besides, if you create the assets by yourself, consider to export to the more modern `glTF` instead.

---

<div class="post-metadata">

**Author:** ![TheNikCD](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/thenikcd/32/11069_2.png) [@TheNikCD](https://discourse.threejs.org/u/TheNikCD)\
**Post date:** [May 27, 2020, 4:17pm UTC](https://discourse.threejs.org/t/problem-with-loading-textures/15602/3 "2020-05-27T16:17:56Z")

</div>

I can’t share file, but I can show by screen demonstration.

I’ll try use glTF

UPD: Use glTF, but I have compilation errors:  
 ![Screenshot_14](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/2X/d/da1d3aa9db1ef3128817956c4b73a6a15142a0d3.png)

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [May 27, 2020, 5:46pm UTC](https://discourse.threejs.org/t/problem-with-loading-textures/15602/4 "2020-05-27T17:46:23Z")

</div>

> [@TheNikCD](#):
>
> I’ll try use glTF

Try to export your asset as a `glb` file. All data of the asset (textures too) will be contained in a single file.

---

<div class="post-metadata">

**Author:** ![TheNikCD](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/thenikcd/32/11069_2.png) [@TheNikCD](https://discourse.threejs.org/u/TheNikCD)\
**Post date:** [May 27, 2020, 6:07pm UTC](https://discourse.threejs.org/t/problem-with-loading-textures/15602/5 "2020-05-27T18:07:41Z")

</div>

This errors when I do glb file. Some textures work, but not all.

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [May 27, 2020, 8:31pm UTC](https://discourse.threejs.org/t/problem-with-loading-textures/15602/6 "2020-05-27T20:31:44Z")

</div>

Without the possibility to inspecting the asset it will be hard to investigate this issue.

What you can try is to check if other glTF viewers can render the file correctly. For example what happens if you view the file via [BabylonJS sandbox](https://sandbox.babylonjs.com/)?

---

<div class="post-metadata">

**Author:** ![TheNikCD](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/thenikcd/32/11069_2.png) [@TheNikCD](https://discourse.threejs.org/u/TheNikCD)\
**Post date:** [May 27, 2020, 9:12pm UTC](https://discourse.threejs.org/t/problem-with-loading-textures/15602/7 "2020-05-27T21:12:30Z")

</div>

It’s better, but not all textures load. maybe I need to save file by different way?

 ![Screenshot_15](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/2X/d/d2d27125918cd89bd881bc3bd7af180a680f04cf.png)
