Any material node to reduce shader instructions from material instance or during runtime?

I have a material in which I have a rain mask which requires loading a separate texture and performing some instructions to modify specularity and so on. I multiply all this with a wetness scalar parameter to control how wet the surface should be.

As far as I understand it, setting this wetness scalar parameter to 0 still makes UE4 run the shader instructions, so the material is still as heavy, no matter if the wetness is 0.0 or 1.0.

I thought that maybe using the if-material-node I could use a simpler route when wetness is 0, but when I set the wetness to 0 in a material instance, it still reports the same number of instructions.

So is there any way to get the engine to “skip” certain nodes and go a more efficient route based on a scalar parameter or bool parameter after the shader is compiled or is the only way to duplicate the material and remove the wetness part entirely?

Or is there some better way to set up my materials?

Can you post a picture of your material?

You would have to change the material to get rid of the calculation.

In Material editor, there is a node called ‘Static Switch Paramter’. It can be changed in a material instance and that compiles an extra set of shader if changed. There are some other standard paramaters public in every material instance that do the same: in the material instance in the general panel there is a tab called ‘Material Property Override’, there you can set the Blendmode or if the material is two sided.

what I am wondering is, if there is already a new shader being used even when I just check the boxes in the material instnace but don’t change the value. Also it is possible to set a material instance as parent for another matrial instance. Maybe it is just an organisational thing but in the end I’d like to know how many shaders I have produced…