Download

QualitySwitch node and Material Layers

Are Material Layers incompatible with the Quality Switch node? I’ve recently looked at moving my game’s materials over to using Material Layers, but can’t seem to get the Quality Switch feature working to hide the more complicated shaders when lowering the material quality. For example, I have tried this in both a blend and a layer:

blend1.jpg

This looks fine and shows the correct color for the current quality in the layer parameters (and in the material editor for the layer/blend):

blend2.jpg

But in-game it always uses the Default node:

blend3.jpg

Even when changing qualities.

As mentioned, I’ve tried the switch in both the layer itself and in the blend function, but no dice.

Is this just a limitation with Material Layers? Is it something that’s broken and I should submit a bug for? Is there a console property I need to flick to enable this for layers? Any help would be much appreciated!

Further investigation, it looks like this may be down to some kind of bug in shader optimisation?

I noticed that if I put a quality switch in the base layer (that does nothing) it fixes this problem as a work-around.

For example, I hooked this up to ‘Emissive Color’ in my base layer (the one referenced in the master material’s MaterialAttributesLayer node):

hookup.jpg

and the material (and all instances/derived materials) now switch based on quality. Having all five qualities hooked up to the same const *does not *work.

So for those interested in a workaround, set up a quality switch similar to the picture above and make sure this is in the material layer that is then referenced as the background in the *master *material.

Thank you for posting an update, helped me out!

A further update - I tried this in 4.26.2 and it seems to be fixed (no longer need a quality switch in the base layer). I’d imagine taking that quality switch out of the base layer allows further optimisation to the shaders.