[Bf-cycles] Patch: some modes of material mix node give incorrect results

Sanne sanne at lavabit.com
Wed May 25 18:49:26 CEST 2011


I found that some of the modes of the Cycles material mix node don't give the 
same results as the same modes in the compositor.

The modes are:
Subtract, Screen, Divide, Difference, Darken, Lighten, Overlay

It turned out that the order of those mix modes in the NodeMix enum in 
intern/cycles/kernel/svm/svm_types.h is different than the order in 
gpu_shader_mix_rgb in source/blender/nodes/intern/SHD_nodes/SHD_mixRgb.c.

Adapting the order in the the NodeMix enum fixed the issue, although I'm not 
sure if this is the correct way to go about this.

Here's the patch:

And here's a blend for checking (top left is compositor, right is material, 
bottom left text block with my test results and notes):


More information about the Bf-cycles mailing list