Perhaps this will be a feature request, but I'm hoping there's a way to do this today.
I am using texture paint to layout textures on a plane. The above image gives a sense of how I'd like to layer materials. Each alpha channel is assigned to a material. This image is just a sample, and not the project I'm working on, but makes for a good illustration.
I have node editor set up with two Principled material shaders currently, and a mix shader with the two materials mapped by a mask image. The difficulty is when you start to add more than two materials. Using mix or add shaders nested one on top of the other with material definitions for each material thrown all into a single node would get messy very fast.
What I'd really like to do is have texture paint by separate distinct materials such as material IDs, with multiple (more than two) materials. I realize that material IDs are generally face-specific assignments, so this may not currently be possible with a texture painting in Blender.
I'm ultimately picturing a way to assign texture maps in a sense similar to Photoshop layers, stacking each material to achieve multiple materials by texture mapping. Another thought is if there's a way to link the outputs of materials as an input node in a central material definition. I could probably make that work without ending up with a massive material definition.
I realize I can use grouping to make the node editor pretty, but this severs the material definitions from a unique material's definition making changes to that material needed to be repeated in multiple places wherever it's being used. Having a single source and linking to other places is much better.
So is there a solution in Blender to efficiently map more than two distinct materials onto a surface?