Material Variation and Blending

Hi folks,

I know similar questions have been asked, but it has been a few years and with UE5 in beta I figured I should ask again, because I generally wasn’t satisfied with those answers or what I could find myself.

I’m an experienced programmer, but total beginner at game development, this is my first time with a game engine, so thanks in advance for putting up with me:

I’m using some megascans surfaces for my terrain and I noticed that the tiling is really obvious.
This seems like a nearly universal problem, so I was a bit surprised that there wasn’t a simple out-of-the-box solution, like having terrain take both a material and a surface imperfection albedo mask.
The tutorials I watched all had people making custom materials and just sampling the texture assets from other materials, which bothered me because it isn’t reusable and violated DRY.
I wanted to be able to apply my macro variation to any existing material with a point and click.

I attempted to make a new layered material that simply applied a macro variation technique (from tutorials) to the layers output, but I discovered that I couldn’t add a material as a material layer. But I knew that material layers can take parameters, so I decided to make a material layer that took a base MaterialAttributes; but a material layer can only have a single MaterialAttributes input (the output of the previous layer). So I decided to just make a regular material that took a base MaterialAttributes param that I could then modify, but it wouldn’t let me add a MaterialAttributes as a material param.

I could make a new material that accepted texture inputs for all the MakeMaterialAttributes, but that would both be tedious to use, and assumes that the material that I want to blend with has no logic and was created entirely from the texture maps.

Is the only way to modify an existing Material Instance really to sample the all the existing material’s texture map assets, modify the texture inputs, and then send them to a MakeMaterialAttributes? it seems so unnecessarily convoluted and unreliable, for something that seems like a common and simple issue, so I’m worried that I’m simply missing something.
Maybe blending materials is only the kind of thing a beginner would want to do, so UE didn’t bother with an OOTB solution?

Did I miss or misunderstand something? Are there any new techniques for blending a material with an albedo mask, or accepting MaterialAttributes in a Material/MaterialLayer?

I think what you are looking for is the ‘Material Layers’ system instead of “Layered Material”
You can’t really build material blending logic that can be applied afterwards to any material. You can use custom material functions in layered materials to create semi- modular sets of logic that can be used while building different materials.
The Material Layers system allows you to make blending logic that can be applied after, in the instance. However, I would advise against it for just doing an albedo blend. It is pretty common to just make custom materials where needed, and faster.
You might be confused about the custom materials in the tutorials you are watching, because you can build them to be reusable using material instances and parameters.

Thanks!

What is the Material Layers system? I was under the impression that Material Layers were created to be layers in a Layered Material, and that a Layered Material was just a Material with the Layers node, which allows you to add layers to the Material instance.
I’ve created a Material Layer Blend that will apply the macro variation technique to blend two Material Layers, and if the layer being blended is solid black, it should achieve the same result - but I don’t know how to get the base material I want into the background layer.

The tutorials I’m following are here and here. They sample texture maps to use for both the base albedo and for the macro variation mask. I see how I can take the texture maps as params, but my concern is that Materials may use more than just their texture maps, and may not even use texture maps at all. I don’t see a way to parameterize a MaterialAttributes, to use as a base material.

to summarize it a bit differently -
I want to be able to say “oh thats a cool Material, i want to use that, but with some dark splotches added to break up the tiling”. I can only figure out how to do this if the material is entirely defined by texture maps, but I’d like to be able to do it for any texture.

Ahh sry im bad at responding here. No they are different systems. Yes Material Layers is what you are looking for. You can create a library of base material layer assets, and then a library of blend assets and mix and match them as you please. To be honest I haven’t seen many people using it. I abandoned it because it ended up being much harder to create reusable blend assets than building something specific. And I found it more difficult to create optimized materials and the material statistics were very buggy. And it was just a pain to manage a whole separate library of materials blends.