# \[Solved\] Material texture update after apply?

**URL:** <https://discourse.threejs.org/t/solved-material-texture-update-after-apply/1651>\
**Category:** Questions\
**Tags:** loaders, textures\
**Created:** [January 19, 2018, 1:28pm UTC](https://discourse.threejs.org/t/solved-material-texture-update-after-apply/1651 "2018-01-19T13:28:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nehemek](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/nehemek/32/971_2.png) [@nehemek](https://discourse.threejs.org/u/nehemek)\
**Post date:** [January 19, 2018, 1:28pm UTC](https://discourse.threejs.org/t/solved-material-texture-update-after-apply/1651/1 "2018-01-19T13:28:11Z")

</div>

Sooo, I have the following snippet:

```
//--- create material
var shader_basic = new THREE.MeshBasicMaterial();
    shader_basic.color = new THREE.Color('cornflowerblue');
    shader_basic.skinning = true;

//--- load model & texture
var system_loader = new THREE.JSONLoader();
var system_texture = new THREE.TextureLoader();

var character = undefined;

system_loader.load('./mushi_min.json', (geometry) => 
    {
    character = new THREE.SkinnedMesh(geometry,shader_basic);
    skeleton = new THREE.SkeletonHelper(character);

    system_scene.add(character);
    system_scene.add(skeleton);

    requestAnimationFrame(main_loop);
    }
    );

system_texture.load('texture.png', texture => 
    {
    shader_basic.map = texture;
    console.log("success");
    });

```

But the following happens:  
If by any reason the texture gets loaded before the object by the browser then it shows up, if not then the material will be just a solid color.

What is the proper way to update a material after a mesh has been created with it?

---

<div class="post-metadata">

**Author:** ![prisoner849](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/prisoner849/32/535_2.png) [@prisoner849](https://discourse.threejs.org/u/prisoner849)\
**Post date:** [January 19, 2018, 1:36pm UTC](https://discourse.threejs.org/t/solved-material-texture-update-after-apply/1651/2 "2018-01-19T13:36:04Z")

</div>

Try this:

```
system_texture.load('texture.png', texture =>
    {
        shader_basic.map = texture;
        shader_basic.needsUpdate = true;
        console.log("success");
    });
```
