# How to apply a new material with alpha texture to a loaded glTF model?

**URL:** <https://discourse.threejs.org/t/how-to-apply-a-new-material-with-alpha-texture-to-a-loaded-gltf-model/11784>\
**Category:** Questions\
**Tags:** gltf-loader\
**Created:** [December 30, 2019, 8:11am UTC](https://discourse.threejs.org/t/how-to-apply-a-new-material-with-alpha-texture-to-a-loaded-gltf-model/11784 "2019-12-30T08:11:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nikolay\_Kananov](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/nikolay_kananov/32/8515_2.png) [@Nikolay\_Kananov](https://discourse.threejs.org/u/Nikolay_Kananov)\
**Post date:** [December 30, 2019, 8:11am UTC](https://discourse.threejs.org/t/how-to-apply-a-new-material-with-alpha-texture-to-a-loaded-gltf-model/11784/1 "2019-12-30T08:11:45Z")

</div>

Hello! Please help me understand how to apply another material and alphaMap to exported model from blender

---

<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:** [December 30, 2019, 10:26am UTC](https://discourse.threejs.org/t/how-to-apply-a-new-material-with-alpha-texture-to-a-loaded-gltf-model/11784/2 "2019-12-30T10:26:28Z")

</div>

You can traverse through the parsed `glTF` scene and replace materials with a new one (using an alpha map). Try to use a code like the following in your `onLoad()` callback:

```auto
var newMaterial = new THREE.MeshStandardMaterial( { alphaMap: map } );

gltf.scene.traverse( ( object ) => {

   if ( object.isMesh ) {

     object.material = newMaterial;

   }

} );

```

---

<div class="post-metadata">

**Author:** ![Nikolay\_Kananov](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/nikolay_kananov/32/8515_2.png) [@Nikolay\_Kananov](https://discourse.threejs.org/u/Nikolay_Kananov)\
**Post date:** [January 21, 2020, 5:17pm UTC](https://discourse.threejs.org/t/how-to-apply-a-new-material-with-alpha-texture-to-a-loaded-gltf-model/11784/3 "2020-01-21T17:17:15Z")

</div>

Thank You so much
