Node Tree for normal input randomly outputs black material for no apparent reason

.blend file download link

I’ve had this very strange and extremely annoying issue with blender recently. (Version 2.82.7, but I get the same results in the latest 2.83 release.)

I’m building a material, and everything will work fine, but at some point, I plug a component into a mixrgb node that is connected to the bump node/normal input of the material (the principled bsdf) and the material will turn black (shadeless).

So far, everytime this has happened, I have been able to track the source down to a black and white image texture node that I painted inside of blender and then saved to my harddrive.

Everytime I have been able to view and render this component previously, everytime it happens relatively late into the material, once it is already a fairly large nodetree, and everytime it happens in the height channel of the material.

Changing the image file in the node, opening the texture in an image editor and reexporting it to a new file, deleting and re-adding the node, as well as purging the data block and reimporting it all do not work. I am able to view the outputs of all channels, which use this component (color, metalness, roughness and even height), only once I plug the height into the bump node and view the actual shader, it breaks.

Appending the material into a new, blank file yields the same result.

(Note: The black material renders extremely fast as if nothing was connected to the material output node.)

Frankly, with so many variables and such a complex material, I’m not even sure how to file a bug report, if it is a bug.

Screenshots:

Material prior to the error:


(node in the height channel at the bottom right muted)

Material after the error:


(node in the height channel at the bottom right enabled)

Node Group Content:


(Selected node is the one causing the error)

Node Group Preview:

Image in question is a simple black and white mask:

Given the complexity of the node tree, it would be useful to have the file (with textures packed in) to analyze. One thing that I noticed in the Node Group Content image is that you apparently have the same image attached to the Subtract node for both inputs - subtracting an image from itself will result in “zero” across the board. Though (just noticed) with different vector inputs, perhaps this offset will yield something?

Is this a node tree you created, or one obtained elsewhere? I ask because it seems to be trying to do a lot, but much of its functionality is not being used (that is, many branches do not actually contribute to the final output). Perhaps make a copy of the material (keeping the original for other use/reference), and delete everything you are not using to clear up the situation. Be careful to make any node groups single user before changing anything in them or all instances will be changed. Perhaps just do all this in a separate file to troubleshoot.

One thing that I noticed in the Node Group Content image is that you apparently have the same image attached to the Subtract node for both inputs

They are actually two different images (the names are very similar). The one on the bottom removes the insides of the areas of the one on top. (You can see the preview of the image on top in the other screenshot.)

I created the node tree myself, so if you have any questions, I can answer them.

I stripped the file of as much data as I could and packed the rest into the .blend file. You can downoad it here. The problem is in the height channel of the material, so I removed all other nodes. If you take a look at the material (called “power-supply”), you should find all the node groups and the corresponding mixrgb nodes color coded, so you can see which mixrgb nodes belong to what group. If you mute some of the mixrgb nodes or nodes within the nodegroups, the material will start appearing again. Which nodes need to be muted seems to be somewhat random (although it doesn’t seem to change.)

For example I can mute the last blue mixrgb node (belonging to “Paint Chipping 1”).

But I can also mute nodes 2 though 5 in the chain instead and it will start rendering too.

If I enable all the mix nodes, but go into the group and mute the two voronoi textures and the “power-supply_bevel.tif” texture nodes, it also renders.

If I enable any of these three nodes, in any combination, it breaks again.

So, yeah - it’s pretty confusing.

I realized that muting and unmuting random nodes in the nodegroups, even the top ones that seem to have nothing at all to do with the problem, sometimes reactivates the material, but might deactive it again when repeadedly muted and unmuted, all seemingly completely random.

In playing with your material, I found that the last mix node in the “Height” box seems to be an issue:

Not knowing your intention, I’ll leave it to you to troubleshoot.