Material Layering System problem

Hello guys, I’ve been working on a system that uses Material Layers to stack a bunch of materials depending on different Blending Layers.

Right now, the setup is as follows:

  • One main material that simply grabs all the information given by the different layers.

  • A Material Layer that writes information in the following channels:

image

  • A Material Layer that simply overrides the incoming BaseColor:

  • And a Material Blending Layer that uses a RGB Mask to lerp between Material Layers:

So my problem comes when I try to create Material Layers that only override specific values, like the one mentioned with the base color or another one that overrides the roughness value. The thing is that even if I pass the new BaseColor via SetMaterialAttributes, leaving the other incoming parameters untouched, it keeps overriding other values like the previous layers Roughness or Normals.

It would be really helpful if you could shed a little bit of light on this topic.

Thank you.

After tweaking and reducing the complexity of the material system I think it has something to do with this part here. It is not receiving the previous layers material attributes but I cant figure out why or how to bypass it.

I know this post is coming up on its 3 year anniversary, but I came across it while searching for a solution to a similar problem.

Same as you, I at first assumed the input material attributes to a material layer was the same as the bottom layer in a material layer blend asset. It is not. The input material attributes to a material layer is whatever is plugged into the material attributes layers node (the one that appears in the actual “main” material).

Here’s the relevant documentation:

Use the input pin to the Material Attributes Layers stack expression in your base Material.

In your standard Material graph, this takes another Material Attribute as input using the Set Material Attributes expression, which will be piped to every layer added to the Material Attribute Layers expression stack.

I personally don’t find it useful this way. It would have been much more useful for me if it was the way you and I were expecting.