I am building mastershaders for my level at the moment. I am wondering wich would be better on a performance side.
Building one master material for instancing with the ability to switch of things like vertex color blending or displacement
or should i build one master shader for every function? And if so should i try to hardwire as much as posible (e.g lets say one master for waterblend one for dirtblend) or keep it open (e.g one Vertexblend shader and plug in water or dirt textures as needed)?
Thats a hard thing to answer.
short answer is “Both”
You want to have a variety of master materials, some for hard surfaces, natural surfaces, particle effects, liquids, etc, etc.
Static Switches/bools can be handy if you drastically need to change a master material (i.e. disable tesselation, refraction, emissive, disable vertex color channels, etc, etc)
I also tried to explain (rather lengthy) how to set up instances & master instances: [UE4] Explaining Master Materials, Master Instances, Instances. (poorly) - YouTube
Well, saying frankly, real-time performance difference is something between non-existent and and negligible. Eventually, it comes down to personal preference and amount of work needed.