Is there a way to add a texture to a specific position on material? (ie. bullet hole or wave if you stepped in water)

Hey!

Is it possible to add a texture to a specific location on a material? For example a wave if you step in the water or a bullet hole in a wall?

And if it is possible, how?

A bullet hole on a wall could be accomplished by using a decal - a texture that is projected onto a surface. Here’s a good tutorial on a blood spatter decal: Unreal Engine 4 Tutorial - Decals (Free Blood Pack) - YouTube

A water ripple/wave could be done using a decal with a normal map to create the illusion of a raised wave. If you were to have it scale up gradually (and fade out) it would look like the wave was ‘expanding’ as things do when dropped into water.
If you need it to be contained in a single material, you’d have to do something with UVs to position the texture. I’m not sure how you’d go about doing that, I think a decal would be simpler.
Hope this helps!

I am already working with decals, I was just curious if there was another way to do this. Thanks for your answer!

UE3 used a “hitMask” to do this. Effectively taking the point and converting that to UV space for a texture parameter in your material. I do not think that exists in UE4 but if you are a programmer it would be a place to start if you wanted to look into what they did before.

Recognize that this system would limit the effect to the edges of the mesh it hit. Decals will overlap multiple objects which can be nice. The hitmasks were very nice since decals on deforming meshes lead to ugliness.

Thanks for your answer! The problem with the decals is, that I had problems spawning them with the built in system and if I spawn them as a class and DecalActor the won’t disappear…aaand at the moment they don’t spawn on my water…so I guess I will use decals for bullet holes and so on and a particle effect for water waves…

Yeah you may definitely have some cleanup to do on your decals. I agree that particles would be best for water in this situation.

I want to make ripples on my water as you go through it and I can distort the water where you are using spheremask but cant work out how to make multiple textures on the water all rippling where you were previously as well as where you are now.

If I were to use decals how would I get them to not effect the ground too? I have other types of decal that I want to affect the ground so I cant just unchecked the receive decal button.

In UE3 you could exclude/include specific meshes in your decal but this appears to not exist anymore. I don’t know if this is an over-site or maybe some artifact of being deferred now.

The best i could recommend is creating a water Surface Type in your Project Settings and applying a Physical Material with that Surface Type to your water areas. This way you can trace, get the physical material surface type and only spawn the decal if it matches.

This would still give you ripple edges on land where a boundary occurs but you could increase the size of your trace (ex: Box Trace) to the size of a ripple and not drop a decal if it hits land maybe.

I cant get decals to work on my water, it seems like you cant place decals on translucent materials, is there a way I can get decals to work in this situation? if not does anyone know how to do this in the material?

You could try the Fluid Surface Plugin.