How to Reduce Decal Stretching?

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!!!

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

Imgur

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:

Imgur
Imgur

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

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

1 Like

Can you show the material?

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.

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

Like this

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

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

It’s a variable…

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

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

Can you upload the texture as a PNG here?


it’s here

1 Like

I did this

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.

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.


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?

Ah no, it’s just not quite straight

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

I think it’s not quite straight.

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