Multiple materials using the same node tree
While working on some procedural space scenes, I've often found myself needing to copy and paste massive parts of my node setups between different materials. For example right now I'm working on a procedural star with volumetric corona and solar flares and I'm trying to set it up in a way in which different volumetric "streaks" of solar wind would correspond to brighter spots on the surface:
This would have been massively simplified if I was able to add multiple material outputs to my node tree and then assign them to different materials in my scene. I do realize that this problem can be somewhat mitigated by using node groups that can indeed be shared between many materials, however I think that implementing a way to use multiple material outputs at the same time would be much simpler and more convenient from the user's perspective as well as could save some processing power since, some operations that at the moment have to be repeated multiple times for different materials would have to be done just once.
3 Comments
A material's look is whatever it's connected to its output.
If you need the same output in multiple materials... why would you need multiple materials in the first place?
If the material uses inputs from the mesh such as VertexColors/Attributes, UVs, etc, they are independent per mesh, so even if they share the same material they would look different.
I didn't say same output, I said same node tree. Your node tree always ends in a material output node, now imagine you want to make something like this:
i.imgur.com/n7wE79q.png
Both the surface material and the volume material use the exact same setup with a voronoi texture, a color ramp and some vector magic to make the voronoi texture produce straight lines instead of spherical blobs. It'd be much more convenient if I could just have one node tree with two separate outputs nodes, one for the surface dots and the second one for the rays coming out of them. Right now I have to either copy and paste the setup between materials and every single time I make a change to one material, I have to do it again for the other one, or use a node group that both materials could share and constantly tab in and out of it whenever I want to make some changes downstream from it.
Edit: and it doesn't only apply to a surface and volume combination, you can have multiple surface or multiple volume materials that use the same "root" in their node tree and then diverge towards the end. and ofc, you could use UVs or any other existing tool, but again, this is much more convenient.
you can use nodegroups to easily reuse or share node setups across materials