LERP between 2 materials

Just a quick question here really.

I have a player character that I simply want to make invisible, but I don’t want him to immediately change his material to the invisibility material (just a basic opacity with refraction material). I’d like to be able to see the material transition slowly from one to the other.

I thought it was easy to do within the main player material (which is opaque), however when changing the material type to translucent, it loses it’s glossiness and depth (literally just looks like a silhouette, even with 1 opacity)

Is there a way to do a LERP between 2 seperate materials (Not textures)?

Or am I going to have to do a harsh switch in material?

I found a node called “InterpolateMaterialInstanceParameters” which appears to be the only thing I can find that seems some-what relevant, however I’m not sure how it works and haven’t been able to get it working.
I plugged the player’s material instance into “self” and “a” then selected the invisibility material inside of B, but …no worky, probably because it’s not what I think it’s for :stuck_out_tongue:

Anyway, help would be greatly appreciated, thanks! :slight_smile:

Could try lerping through material functions and make another function containing the material breaks and lerps?

Hmmm, I’ll need to look into material functions, I’m honestly not too knowledgeable with the material editor or materials in general, I just thought this might be a simple process and I have completely overlooked it haha.

I’ll look into material functions and see how they work as I’m not entirely sure what you mean at all unfortunately :frowning:

Hi!

You can use Layers for blend two or more materials. And of course you can dynamically adjust blending your materials.

This is example

1 Like

Thank you svv3dUDN :slight_smile:
This is very helpful, but unfortunately does not quite do the job.

One material has a blend mode of Opaque, it has an orange base colour, 0 metallic and 0.4 roughness, but no opacity or refraction channels etc, the other material is simply a Translucent blend mode material with 0 opacity and 1.1 refraction.

If I make the new material into an opaque one, and set the LERP value to 1 (should be fully transparent with refraction) the material just goes black.

If I make the new material translucent with a value of 1, it functions how it should, however if the lerp was 0, there is no metallic value, no roughness etc, it’s just a flat base colour :frowning:

I also tried to change blend mode to Masked, and tried to LERP between the 2 masks, but the orange colour only goes slightly darker as the mask goes from full white to full black up until a LERP value of 0.66, then becomes 100% transparent.
I can change the opacity mask clip value which allows the colour to go darker as the opacity mask goes to full black, but still remains at 1 opacity until the threshold/clip value is reached before suddenly becoming invisible, but it’s not a smooth transition at all.

I swear I have seen this done somewhere in UE4, I just feel kinda durpy that I haven’t worked it out haha :frowning: