UE 4.27 - Adding translucent material on top of the gun material?

Hi, how can I add another material on top of the gun material? I want it to highlight the object.
Highlight
I’m thinking something similar to these:
2025-03-20_21-27-14

check the field “outline material” on the mesh

though, since that ui suggests highlighting different parts of the mesh, and since that effect is made so that it does not depend on the shape on the mesh, i’ll go with a post process.
check the use custom stencil id on the mesh, and you can use that on a postprocess.
there are ton of articles online on how to use it. search for outline effect for example. i think tom looman has a good one.

1 Like

You don’t actually need a second material. You can simply use a lerp node within one material to blend between two different looks.

UE also has a layered material system, where you can put two materials on the same mesh and then use a blend function to mix them. It’s a bit more complicated and expensive, but more versatile than hard-coding a specific blend within a material.

Here’s the documentation for the material layers system.

Later versions of unreal (but not the one you mentioned unfortunately) also have a specific tool to very easily overlay a translucent material for this specific reason called overlay materials.

1 Like

The idea is: When the player picks up the gun, the highlighting effect disappears. How can I control to turn this effect off?

With the alpha of the lerp. A lerp node has two inputs A and B and an alpha. For example, you can put your normal material in A, the effect in B and the blend in the Alpha. To stop it dynamically, you can use “Per Instance Custom Data.” This is a value that can be set on a per instance basis via code or BP that the material can read.

So for example if the value is 1 the effect is on, if the value is 0 it is off. You can multiply your materials blend factor by this value to switch it on and off.

Guess what? I did it through the Material Function, at least I got the desired result.

And since the glowy thing is a funtion, i can put it inside any material i need to reuse it


Highlight3

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.