# Shader turns black when connected to node group

I have a project where I reuse the same material for multiple things. So, I use node groups; saves a lot of trouble - at first!

Up to this problem I have with node groups:

In 1 you can see, that the logo (white text) is on a black background. This black background should be a node group (and certainly not black).

Here is the Logo Overlay node group:

If I put the node group "ultramarinblau" into the Logo Overlay node group, it does not work!

Only if I add the "ultramarinblau"-node group directly into the Logo Overlay node group, it works:

This behavior is not desired. I'd like to reuse my Logo Overlay node group multiple times with a different node group-input.

What am I doing wrong? Or could this be a limitation of Cycles node groups?

Any ideas are appreciated!

This is because you are plugging a Shader output (green) into a color input (yellow). See What is the meaning of the color of the node sockets in the node editor?

Instead you should add a shader input (green) to the "Logo Overlay" group. Doing this is a little complicated, as you currently can't directly set the socket type without some python. However, it is possible:

1. Enter the node group (↹ Tab)

2. Plug the placeholder output of the Group Input node (hollow) into any input socket of the desired type. In this case, green for shader:

Optionally rename the new input in the properties panel (N).

Once this is done, your setup should work.

I don't recommend putting the material output node inside a node group, as this could lead to confusion down the road depending on how the group is used. Instead you might want to plug the mix shader into a Group Output node, and plug the entire group node into the material output in the main node tree.

• Ok, I think I understand what you mean. But, how would I change the imput type to shader? Even if I connect the third input directly to my Mix Shader (from Logo Overlay), it does not change color (of the group input node). – gilu Jul 29 '15 at 6:42
• @gilu Once the socket is created it's type can't be changed. You'll have to create a new socket by connecting the blank output (bottom). Then you can delete any unneeded sockets in the properties panel (N). – gandalf3 Jul 29 '15 at 6:48
• Bingo! I had to remove the node and reconnect it! Thanks, gandalf3! – gilu Jul 29 '15 at 6:49
• You're right, I removed the output node from the group as well. This adds more flexibility as well. Since displacement can now be controlled outside the logo group. – gilu Jul 29 '15 at 7:09