Multiple Shaders with Shared Node Graph?

Is there some way to have multiple material instances reference a common node graph with the ability to change parameters without affecting the others?

I.E. Say I have a complex node set up for a shader that I need to apply to several objects, each with a different color. I need to specify which object is what color, so the object info “random” attribute would not be appropriate. Is there a way to set the color for each object, but reference a common node graph such that any other parameters or the node structure remains common such that it can be applied to all objects, while the color parameter can be applied to the specific object? Is there any way for specific parameters to be attributed locally to objects, while others are globally attributed to the material?

The way I have been doing it is simply duplicating the material and changing the color for each. The problem is if I notice a problem later on I have to delete each colored material, adjust the shader, duplicate and apply the color to each one.

Is there a better way? Let me know if I’m not being clear.

Add nodes to a node group (Ctrl+G). This group can be added to any other material
You can have an input to the node group for a colour so the material can be the same but with a different colour

1 Like

If I needed to adjust the group such that changes are affected by other materials, can I? Similar to a group instance?

Oh duh. Ofcourse it would! I’m not sure why I thought it wouldn’t. Brain fart moment.

Thanks for your help :slight_smile: