diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-12-16 14:52:40 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-12-16 18:06:25 +0300 |
commit | 1549fea9995c348bc14a9105df5e460644e2b33a (patch) | |
tree | c09b24360f687dd4e382fedcff8c720f9784ceb1 /intern/cycles/kernel/svm/svm_sepcomb_hsv.h | |
parent | 137f55724606e07f1cdc829c730fc0c061d7af21 (diff) |
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.
Diffstat (limited to 'intern/cycles/kernel/svm/svm_sepcomb_hsv.h')
-rw-r--r-- | intern/cycles/kernel/svm/svm_sepcomb_hsv.h | 5 |
1 files changed, 3 insertions, 2 deletions
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); |