[BUG?] Using static switch parameter with materials causes it to output a blank material

Trying to set up a tile-able wall material with the option of having mold or not as a parameter seems that this happens:

With Switch:

Without Switch

Not sure if the switch is supposed to be used with materials but it doesn’t throw an error.

Hi Aiden,

The problem with using a StaticSwitch is that it will be set at compile time. When materials are compiled, they collapse and optimize, but a StaticSwitch will prevent that. They should still work, but it is going to have lower overall performance.

As far as the black material goes, it looks like the outputMatLayer for your oldbrick Material Layer may be outputting black. I can’t see how it is set up and there are a few nodes offscreen. Would you be willing to share the .uassets so that I can test them on our system? If not, some additional screenshots may help in this investigation.

Thank you,

Alexander

both images are the same up until the switch the few nodes off screen are just vector3 params. I’ve attached the material if you want to check it out.

link text

Hi Aiden,

I took a look at your set up and did some debugging. Static switches are only looking at one property at a time and when the information going into it has several material properties, you get a blank material.

I do have a work-around that would allow you to have a parameter decide if a wall is moldy or not. You can use a MatLayerBlend_Simple to blend the outputs of your other MatLayerBlend and MATLAYER_OldBrick. Use a Scalar Parameter for the alpha. That way you can decide which one to pick by using Blueprints to give the param a value of 0 to 1. You could even use a float to lerp between the two materials to have mold appear slowly on your walls.

Here is an example of the material:

Please let me know if you have any more questions. I hope this has helped you with your material.

Cheers,

Alexander