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?