Right now its all hard coded into the shader and it works fine, but I want to organize it so I can use Material Instances.
Here is my issue, I want to be able use prepacked material functions because I can hook up all the tileable textures I need to the material function instead of hooking up every tileable texture to every layer of the material instance. Here are some screenshots to help show what I mean.
Material Function 1, for a tileable red brick:
I know I can individually hook up every texture in the material instance, but I really want to figure out how to use these material functions as quick presets to grab and change materials around.
Yeah, a material isn’t a valid parameter for a material unfortunately. Once you start seeing how your material is converted into code and how it all fits together you realise what a monumental task that would be. It would undo so many optimizations as well.
However, there might be a better solution. Have you tried painting with material layers on landscapes? Is it possible to do this on meshes as well?
Material Functions will pass their parameters along to any parent material that uses them. They’re just collapsed nodes, nothing more.
If like Mootjuh says you make the texture samplers in the function parameters (and ensure you name them uniquely across different material functions), they will show up when you instance the master material.