# Decal created on the basis of the cloned texture is not displayed

**URL:** <https://discourse.threejs.org/t/decal-created-on-the-basis-of-the-cloned-texture-is-not-displayed/20560>\
**Category:** Questions\
**Tags:** decal, textures\
**Created:** [November 9, 2020, 2:02pm UTC](https://discourse.threejs.org/t/decal-created-on-the-basis-of-the-cloned-texture-is-not-displayed/20560 "2020-11-09T14:02:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zakhar\_Nycheporuk](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/zakhar_nycheporuk/32/14086_2.png) [@Zakhar\_Nycheporuk](https://discourse.threejs.org/u/Zakhar_Nycheporuk)\
**Post date:** [November 9, 2020, 2:02pm UTC](https://discourse.threejs.org/t/decal-created-on-the-basis-of-the-cloned-texture-is-not-displayed/20560/1 "2020-11-09T14:02:49Z")

</div>

I’m working on customizing a 3D model of jeans, and with the addition of the flipX function it doesn’t work correctly. It’s built on basis of [Examples/decals](https://threejs.org/examples/#webgl_decals)

> Here I’m modifying texture, and applying it to material

`// texture is an image, loaded by TextureLoader`  
`texture.wrapS = THREE.RepeatWrapping;`  
`texture.repeat.x = flipX; // -1 or 1 `  
`decalMaterial.map = texture;`

> This code is in the function that is responsible for adding decal on click

`position.copy(intersection.point);`  
`orientation.copy(mouseHelper.rotation);`

`let material = decalMaterial.clone();`  
`material.color.set(textureColor);`  
`let decal = new THREE.Mesh(new DecalGeometry(basicModel, position, orientation, size), material);`  
`scene.add(decal);`

It works perfectly fine, until I’m switching flipX

 ![Screenshot from 2020-11-09 15-26-23](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/2X/f/f26b7ac34d06221f522b87f5b51eac3e190e64cd.jpeg)

Because all decals use the same texture, if I change it, it changes even on existing decals

 ![Screenshot from 2020-11-09 15-31-36](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/2X/0/0d0d7c469ae8e2ed3a9e6e5f3dfcd16101f03ee9.jpeg)

Then I tried to use the copy of texture on each decal

`let t = new THREE.Texture();`  
`t = texture.clone(); // or t.copy(texture);`  
`t.wrapS = THREE.RepeatWrapping;`  
`t.repeat.x = flipX; // -1 or 1`  
`decalMaterial.map = t;`

I don’t know why, but it adds new mesh to the scene, but it’s not appearing on the canvas.

The only solution I see, is to create duplicate set of textures, and apply it if FlipX is on, but it will use additional traffic and memory, so it’s bad solution.

Does anyone have an idea how to solve this?

---

<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:** [November 9, 2020, 5:28pm UTC](https://discourse.threejs.org/t/decal-created-on-the-basis-of-the-cloned-texture-is-not-displayed/20560/2 "2020-11-09T17:28:57Z")

</div>

> [@Zakhar\_Nycheporuk](#):
>
> t = texture.clone(); // or t.copy(texture);

After this line, can you please add:

```js
t.needsUpdate = true;

```

Does it make any difference?

---

<div class="post-metadata">

**Author:** ![Zakhar\_Nycheporuk](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/zakhar_nycheporuk/32/14086_2.png) [@Zakhar\_Nycheporuk](https://discourse.threejs.org/u/Zakhar_Nycheporuk)\
**Post date:** [November 9, 2020, 5:47pm UTC](https://discourse.threejs.org/t/decal-created-on-the-basis-of-the-cloned-texture-is-not-displayed/20560/3 "2020-11-09T17:47:13Z")

</div>

It did help!!!  
Thank you!!!
