# Moving decal performance issue

**URL:** <https://discourse.threejs.org/t/moving-decal-performance-issue/72467>\
**Category:** Questions\
**Tags:** decal, decals, performance\
**Created:** [October 6, 2024, 6:29am UTC](https://discourse.threejs.org/t/moving-decal-performance-issue/72467 "2024-10-06T06:29:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![smhlotfi](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/smhlotfi/32/50765_2.png) [@smhlotfi](https://discourse.threejs.org/u/smhlotfi)\
**Post date:** [October 6, 2024, 6:29am UTC](https://discourse.threejs.org/t/moving-decal-performance-issue/72467/1 "2024-10-06T06:29:59Z")

</div>

I’m developing a project to add and move some decals on a T-shirt.  
 ![photo_2024-10-06_09-55-32](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/8/3/83a70ed825ef787750f821dfc7b21c2a2929af5b.jpeg)

If you drag the move button, you can move the decal where you want. But there is a little performance issue related to how the decal moves.  
The only solution I found for moving the decal is removing the current decal geometry and creating a new one **for each frame** like this:

```javascript
decalMesh.geometry.dispose();
            var decalGeometry = new DecalGeometry( mesh, decalPos, decalRot, decalScale );
            decalMesh.geometry = decalGeometry;

```

This solution led to performance issues.

Does anyone have a solution?

---

<div class="post-metadata">

**Author:** ![Fennec](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/fennec/32/59265_2.png) [@Fennec](https://discourse.threejs.org/u/Fennec)\
**Post date:** [October 6, 2024, 2:37pm UTC](https://discourse.threejs.org/t/moving-decal-performance-issue/72467/2 "2024-10-06T14:37:09Z")

</div>

It seems like the t-shirt geometry is too big, you can Simplify/Dissolve it.

Or a more drastic approach, require a complete rebuild of your app, edit the texture using UVs and canvas, instead of a decal.

---

<div class="post-metadata">

**Author:** ![smhlotfi](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/smhlotfi/32/50765_2.png) [@smhlotfi](https://discourse.threejs.org/u/smhlotfi)\
**Post date:** [October 7, 2024, 6:00am UTC](https://discourse.threejs.org/t/moving-decal-performance-issue/72467/3 "2024-10-07T06:00:28Z")

</div>

Thank you for your reply, the issue is about deleting and creating decals in each frame.  
Your solution about using texture with UVs and canvasTexture 2D is completely feasible and I think it is the best solution, but as you said, this solution requires a complete rebuild of the app.  
I’m seeking a solution to optimize the decal movement.

---

<div class="post-metadata">

**Author:** ![Fennec](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/fennec/32/59265_2.png) [@Fennec](https://discourse.threejs.org/u/Fennec)\
**Post date:** [October 7, 2024, 6:13am UTC](https://discourse.threejs.org/t/moving-decal-performance-issue/72467/4 "2024-10-07T06:13:41Z")

</div>

Have you tried a low poly t-shirt geometry, did the performance issue persist?

---

<div class="post-metadata">

**Author:** ![smhlotfi](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/smhlotfi/32/50765_2.png) [@smhlotfi](https://discourse.threejs.org/u/smhlotfi)\
**Post date:** [October 7, 2024, 7:33am UTC](https://discourse.threejs.org/t/moving-decal-performance-issue/72467/5 "2024-10-07T07:33:41Z")

</div>

Thank you for your reply. Reducing the t-shirt geometry polygons fixed the performance issue.
