# How to Reduce Decal Stretching?

**URL:** <https://forums.unrealengine.com/t/how-to-reduce-decal-stretching/1192458>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, question\
**Created:** [June 8, 2023, 5:21am UTC](https://forums.unrealengine.com/t/how-to-reduce-decal-stretching/1192458 "2023-06-08T05:21:55Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guesscui2018](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Guesscui2018](https://forums.unrealengine.com/u/Guesscui2018)\
**Post date:** [June 8, 2023, 5:21am UTC](https://forums.unrealengine.com/t/how-to-reduce-decal-stretching/1192458/1 "2023-06-08T05:21:55Z")

</div>

I’m working on a FPS game where I need to spawn decal on the wall behind an enemy I shot after the bullet went through the enemy, the problem is, when the decal get passed some worldstatic objects, it projects long stretched lines on them along the way it goes.  
I wonder is there a way to make the decal “wrap” around the world objects, instead of “cutting” through them? and if it’s doable, what should I be looking at?  
Any hints or tips? Many many thanks!!!

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [June 8, 2023, 6:48am UTC](https://forums.unrealengine.com/t/how-to-reduce-decal-stretching/1192458/2 "2023-06-08T06:48:06Z")

</div>

You can stop decals from projecting on more than one axis by lerping the opacity with this expression

[![Imgur](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/1/0/b10a3dc0cf5bce2ad684822682220d7a2ca84594.png "imgur.com") ](https://imgur.com/PCtsNv7)

---

<div class="post-metadata">

**Author:** ![Slavq](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Slavq](https://forums.unrealengine.com/u/Slavq)\
**Post date:** [June 8, 2023, 7:50am UTC](https://forums.unrealengine.com/t/how-to-reduce-decal-stretching/1192458/3 "2023-06-08T07:50:59Z")

</div>

Another option, to make them ‘wrap’ around objects, can be a spherical projection, but then you need to specify the direction vector for each decal (can be e.g. from a bullet hit direction).  
More info is available here:

> **[Valorant decals approach](https://realtimevfx.com/t/valorant-decals-approach/13160/5)**
>
> Hi. I did the vfx for Raze. Wyvery’s 3rd suggestion is pretty much what we did. There were earlier versions where I was using triplanar mapping but I’d get these extremely noisy seams between projection axes when the decal was projected over...

[![Imgur](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/7/2/97242fe95aff221a02b79cf925552cb95e1dd9b1.png "imgur.com") ](https://imgur.com/jMuUJCL)  
[![Imgur](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/3/0/7305e598a55297f7b0124d4ff69567aeac91ef46.png "spherical projection decal shader") ](https://imgur.com/MR8hLqO)

---

<div class="post-metadata">

**Author:** ![Guesscui2018](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Guesscui2018](https://forums.unrealengine.com/u/Guesscui2018)\
**Post date:** [June 8, 2023, 11:59pm UTC](https://forums.unrealengine.com/t/how-to-reduce-decal-stretching/1192458/4 "2023-06-08T23:59:20Z")

</div>

Thank you so much for the detailed BP graph, I’ll try it out.

---

<div class="post-metadata">

**Author:** ![Guesscui2018](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Guesscui2018](https://forums.unrealengine.com/u/Guesscui2018)\
**Post date:** [June 9, 2023, 12:01am UTC](https://forums.unrealengine.com/t/how-to-reduce-decal-stretching/1192458/5 "2023-06-09T00:01:08Z")

</div>

![TextureBlackEdge](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/e/e/0ee139e4973db657fbee1e88145312926e94095a.jpeg)

Thank you so much, I tried it and it seems working, only the decal texture is showing black on the areas should be transparent. What setting should I be correcting?  
Thanks, sorry I’m pretty new to material coding lol

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [June 9, 2023, 7:14am UTC](https://forums.unrealengine.com/t/how-to-reduce-decal-stretching/1192458/6 "2023-06-09T07:14:01Z")

</div>

Can you show the material?

---

<div class="post-metadata">

**Author:** ![Guesscui2018](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Guesscui2018](https://forums.unrealengine.com/u/Guesscui2018)\
**Post date:** [June 9, 2023, 7:37am UTC](https://forums.unrealengine.com/t/how-to-reduce-decal-stretching/1192458/7 "2023-06-09T07:37:36Z")

</div>

Sorry I probably set it wrong, I’m just confused about where should I connect it to. I’ve captured a screen of the current graph for you, maybe it’s easy to just circle around on the image to point out where to connect things? Right now I just have them disconnected.

 ![MaterialGraph](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/1/3/913560d764fca8a31aec73ff0371c5cd91be09b1.jpeg)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [June 9, 2023, 8:02am UTC](https://forums.unrealengine.com/t/how-to-reduce-decal-stretching/1192458/8 "2023-06-09T08:02:39Z")

</div>

Does it work without the hack? ( I’m just checking the texture has a good alpha )

Like this

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/4/4/744646a79b30be19a9a0a4babc2631f10b1e61c2.png)

Don’t worry about the mask texture, it’s the other bit you need…

---

<div class="post-metadata">

**Author:** ![Guesscui2018](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Guesscui2018](https://forums.unrealengine.com/u/Guesscui2018)\
**Post date:** [June 9, 2023, 8:19am UTC](https://forums.unrealengine.com/t/how-to-reduce-decal-stretching/1192458/9 "2023-06-09T08:19:27Z")

</div>

Thanks, can I ask what’s the projectioncorrection node? I couldn’t get this node it seems… lol

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [June 9, 2023, 8:20am UTC](https://forums.unrealengine.com/t/how-to-reduce-decal-stretching/1192458/10 "2023-06-09T08:20:30Z")

</div>

It’s a variable…

---

<div class="post-metadata">

**Author:** ![Guesscui2018](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Guesscui2018](https://forums.unrealengine.com/u/Guesscui2018)\
**Post date:** [June 9, 2023, 8:22am UTC](https://forums.unrealengine.com/t/how-to-reduce-decal-stretching/1192458/11 "2023-06-09T08:22:29Z")

</div>

Ok so I set it up like the image. The projection seems working only I still get the black edges.

 ![123](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/8/f/b8fdef421035e987bf622f7e34bf48cd4b1555ba.jpeg)

---

<div class="post-metadata">

**Author:** ![Guesscui2018](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Guesscui2018](https://forums.unrealengine.com/u/Guesscui2018)\
**Post date:** [June 9, 2023, 8:22am UTC](https://forums.unrealengine.com/t/how-to-reduce-decal-stretching/1192458/12 "2023-06-09T08:22:52Z")

</div>

Plus the material itself works fine, it’s just I wanted to get rid of the stretching

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [June 9, 2023, 8:27am UTC](https://forums.unrealengine.com/t/how-to-reduce-decal-stretching/1192458/13 "2023-06-09T08:27:39Z")

</div>

Can you upload the texture as a PNG here?

---

<div class="post-metadata">

**Author:** ![Guesscui2018](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Guesscui2018](https://forums.unrealengine.com/u/Guesscui2018)\
**Post date:** [June 9, 2023, 8:32am UTC](https://forums.unrealengine.com/t/how-to-reduce-decal-stretching/1192458/14 "2023-06-09T08:32:36Z")

</div>

![Blood_TEX_02_a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/d/4/ed49276bb864b0245e88fa8788d3309b0ff5450d.png)  
it’s here

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [June 9, 2023, 8:36am UTC](https://forums.unrealengine.com/t/how-to-reduce-decal-stretching/1192458/15 "2023-06-09T08:36:11Z")

</div>

I did this

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/f/4/6f4511f15f0d1ec4308a89eca6aeb2c41fef0612.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/b/d/2bd260a9538d1107f3269ff31bc5645c556570a4.jpeg)

Notice how it only applies to the face I put it on.

The point is, the lerp is using that object orientation node to decide whether or not to show the decal. So we use the projection to turn the decal on/off.

---

<div class="post-metadata">

**Author:** ![Guesscui2018](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Guesscui2018](https://forums.unrealengine.com/u/Guesscui2018)\
**Post date:** [June 9, 2023, 8:47am UTC](https://forums.unrealengine.com/t/how-to-reduce-decal-stretching/1192458/16 "2023-06-09T08:47:03Z")

</div>

Thanks, I think I’m getting there now, only it still have a bit of visible stretch but this time it’s in gray color… I attached a screenshot also the graph.

 ![123](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/b/b/3bb5f8184312af22240eb8ec5013c5ae5aeba119.jpeg)  
 ![321](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/b/f/bbf7d674785afc2f75fc4721b040b769c66b62ff.jpeg)

---

<div class="post-metadata">

**Author:** ![Guesscui2018](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Guesscui2018](https://forums.unrealengine.com/u/Guesscui2018)\
**Post date:** [June 9, 2023, 8:49am UTC](https://forums.unrealengine.com/t/how-to-reduce-decal-stretching/1192458/17 "2023-06-09T08:49:55Z")

</div>

Maybe that has something to do with my texture? I have piled couple same decal materials at the same location after the weapon shooting. Maybe the gray area is showing is because of the alpha piled up?

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [June 9, 2023, 8:56am UTC](https://forums.unrealengine.com/t/how-to-reduce-decal-stretching/1192458/19 "2023-06-09T08:56:46Z")

</div>

Ah no, it’s just not quite straight

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/2/e/b2ec8561fc3079a53984b545be95866f08660bec.jpeg)

---

<div class="post-metadata">

**Author:** ![Guesscui2018](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Guesscui2018](https://forums.unrealengine.com/u/Guesscui2018)\
**Post date:** [June 9, 2023, 8:58am UTC](https://forums.unrealengine.com/t/how-to-reduce-decal-stretching/1192458/20 "2023-06-09T08:58:09Z")

</div>

No it’s not a shadow, it’s showing it without any shadow enabled for the material.

 ![1234](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/6/b/b6bc590ac4973ae31fc255452da3e4a7fdf702d0.jpeg)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [June 9, 2023, 8:58am UTC](https://forums.unrealengine.com/t/how-to-reduce-decal-stretching/1192458/21 "2023-06-09T08:58:45Z")

</div>

I think it’s not quite straight.

What’s your code for aligning the decal with the object?

[Next page](https://forums.unrealengine.com/t/how-to-reduce-decal-stretching/1192458.md?page=2)
