From 1549fea9995c348bc14a9105df5e460644e2b33a Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 16 Dec 2014 16:52:40 +0500 Subject: Fix T42888: Separate and Combine HSV distorts the hue value These nodes were assuming sRGB input/output which is for sure wrong for the shader pipeline which works in the linear space. So now conversion to/from linear space happens in these nodes which makes them making sence in the shader context but which might change look and feel of existing scenes. --- intern/cycles/kernel/svm/svm_sepcomb_hsv.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'intern/cycles/kernel/svm') diff --git a/intern/cycles/kernel/svm/svm_sepcomb_hsv.h b/intern/cycles/kernel/svm/svm_sepcomb_hsv.h index 111d5d47988..abf75b62bd5 100644 --- a/intern/cycles/kernel/svm/svm_sepcomb_hsv.h +++ b/intern/cycles/kernel/svm/svm_sepcomb_hsv.h @@ -26,7 +26,8 @@ ccl_device void svm_node_combine_hsv(KernelGlobals *kg, ShaderData *sd, float *s float value = stack_load_float(stack, value_in); /* Combine, and convert back to RGB */ - float3 color = hsv_to_rgb(make_float3(hue, saturation, value)); + float3 color = color_srgb_to_scene_linear( + hsv_to_rgb(make_float3(hue, saturation, value))); if (stack_valid(color_out)) stack_store_float3(stack, color_out, color); @@ -40,7 +41,7 @@ ccl_device void svm_node_separate_hsv(KernelGlobals *kg, ShaderData *sd, float * float3 color = stack_load_float3(stack, color_in); /* Convert to HSV */ - color = rgb_to_hsv(color); + color = rgb_to_hsv(color_scene_linear_to_srgb(color)); if (stack_valid(hue_out)) stack_store_float(stack, hue_out, color.x); -- cgit v1.2.3