Hue color blend giving different results between Eevee and Cycles

I’m working on a material and I’ve got a result that I quite like in material preview, but when I bake it out I end up getting a different result than what material preview was showing.

As best as I can tell, it looks like Eevee is calculating the Hue blend differently than Cycles does, but I can’t figure out why.

Looking at the Blender source code, the Hue blend of the color mix node checks if the Saturation doesn’t equal zero, and if it does just returns the base color unchanged, which is what I’m getting from Cycles. But Eevee is giving me something different, which doesn’t make any sense (maybe Eevee is doing the float to RGB conversion differently, but I can’t find where in the Eevee source code the blends and converts happen).

Here’s what I’m getting from Eevee:

And here’s what I’m getting from Cycles:

And here’s my node setup:

If anyone has ideas how I can get the Eevee result in Cycles, I’d be grateful. The closest I’ve been able to get is manually doing the hue replace, and then vector math reflect of the resulting color against the original, but it’s still not quite right as there’s a lot more green in that result.

Are you able to upload the file? Kind of hard to tell the problem just from the nodes…

It’s really not hard to reproduce. Just plug the Fac output of a noise texture into B in a Mix Color → Hue node and set the top color to just about anything other than pure white. Eevee gives you noise, Cycles gives you the A color input on the Mix Color node.

Cycles render in the left 3d viewport, Material Preview (eevee) on the right

1 Like

There does seem to be some bug going on here, but I think there’s gotta be a better way to go about this.

I’m not sure that doing a 100% factor hue blend on a b/w input really makes sense.

2 Likes