Commit: 98547e8817b35470fdf3bc19ded9b6695db5a8ad
Author: Alexander Gavrilov
Date:   Sun Jun 19 14:55:10 2016 +0300
Branches: master
https://developer.blender.org/rB98547e8817b35470fdf3bc19ded9b6695db5a8ad

Fix Cycles RGB and Vector Curves node Fac handling.

===================================================================

M       intern/cycles/kernel/svm/svm_ramp.h

===================================================================

diff --git a/intern/cycles/kernel/svm/svm_ramp.h 
b/intern/cycles/kernel/svm/svm_ramp.h
index 59dec40..24275d0 100644
--- a/intern/cycles/kernel/svm/svm_ramp.h
+++ b/intern/cycles/kernel/svm/svm_ramp.h
@@ -92,11 +92,11 @@ ccl_device void svm_node_rgb_curves(KernelGlobals *kg, 
ShaderData *sd, float *st
        const float min_x = __int_as_float(node.z),
                    max_x = __int_as_float(node.w);
        const float range_x = max_x - min_x;
-       color = (color - make_float3(min_x, min_x, min_x)) / range_x;
+       const float3 relpos = (color - make_float3(min_x, min_x, min_x)) / 
range_x;
 
-       float r = rgb_ramp_lookup(kg, *offset, color.x, true, true, 
table_size).x;
-       float g = rgb_ramp_lookup(kg, *offset, color.y, true, true, 
table_size).y;
-       float b = rgb_ramp_lookup(kg, *offset, color.z, true, true, 
table_size).z;
+       float r = rgb_ramp_lookup(kg, *offset, relpos.x, true, true, 
table_size).x;
+       float g = rgb_ramp_lookup(kg, *offset, relpos.y, true, true, 
table_size).y;
+       float b = rgb_ramp_lookup(kg, *offset, relpos.z, true, true, 
table_size).z;
 
        color = (1.0f - fac)*color + fac*make_float3(r, g, b);
        stack_store_float3(stack, out_offset, color);
@@ -121,11 +121,11 @@ ccl_device void svm_node_vector_curves(KernelGlobals *kg, 
ShaderData *sd, float
        const float min_x = __int_as_float(node.z),
                    max_x = __int_as_float(node.w);
        const float range_x = max_x - min_x;
-       color = (color - make_float3(min_x, min_x, min_x)) / range_x;
+       const float3 relpos = (color - make_float3(min_x, min_x, min_x)) / 
range_x;
 
-       float r = rgb_ramp_lookup(kg, *offset, color.x, true, true, 
table_size).x;
-       float g = rgb_ramp_lookup(kg, *offset, color.y, true, true, 
table_size).y;
-       float b = rgb_ramp_lookup(kg, *offset, color.z, true, true, 
table_size).z;
+       float r = rgb_ramp_lookup(kg, *offset, relpos.x, true, true, 
table_size).x;
+       float g = rgb_ramp_lookup(kg, *offset, relpos.y, true, true, 
table_size).y;
+       float b = rgb_ramp_lookup(kg, *offset, relpos.z, true, true, 
table_size).z;
 
        color = (1.0f - fac)*color + fac*make_float3(r, g, b);
        stack_store_float3(stack, out_offset, color);

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to