[Solved] Mix two roughness values using RGB mix colour nodes — What is going on there?

To optimise the material noodles, I usually try to avoid extra shader nodes—that are slow to calculate—and use instead colour mix nodes.
The difference in speed is evident, but in a recent test I have noticed that the results are slightly different.

Here is my test setup:


In the yellow frame two glossy mixed with fresnel, in the blue frame one glossy with the roghness driven by colour mix + fresnel.

For the roughness value I have used the «value» of the HSV tab of the colour input node, that AFAIK should be linear. The values are shown in the unconnected value nodes.

Here are the results with 144 samples:

  1. two glossy + mix shader 00:51.81


  2. one glossy + colour mix 00:47:20


In the following post another image.

Here the output of the first screenshot, 36 samples:

left: glossy+glossy+mix shader
right: glossy+colour mix


Why am I having this result? I expect the two setup to give the same result.

If you connect a color input to single value input, the first channel is connected. So you actually connect red channel to roughness. Instead of setting “value” in color node HSV tab, that produces RGB values through some arbitrary logic (you can look it up from wiki), use Value node instead or set RGB values directly.

What the actual differences are is hard to tell because your two setups are not from the same position and so all the reflections have shifted. Render with both materials from exactly the same position so that only material changes and everything else in scene is the same.

I don’t know how to convert exactly a value for an RGB node. But the point is that I have connected both materials’ roughness with the same RGB node, so the results should be the same.

In the first post there is the same scene rendered with the two setups: the render results are on the bottom. It is quite evident that the second one has a higher roughness (it is more blurry).

Sorry, for some reason I did not notice that the second post had split comparison of two materials.

I think the source of difference is that when you mix two glossy shaders that have different roughness values, the area where they both are partially contributing will have a mix of sharp and blurred reflection (both reflections are visible, looks like they are layered). But when you mix the roughness values before glossy shader, that area will have roughness value that is simply between the two and this loses the layered effect.

I guess this is right. I have also found the same answer here http://blender.stackexchange.com/a/41312/25155

My setup is useful only when the map driving the mix is black and white monochromatic, thus without gray values.

[How can I mark this thread as «solved»?]