Revert "Fix T42888: Separate and Combine HSV distorts the hue value"

This reverts commit 1549fea9995c348bc14a9105df5e460644e2b33a.

After some further discussion with other developers in the team it becomes
clear there's no correct solution here. It is just more matter of what's
more convenient in particular case.

We're just going back to old code to avoid possible frustration with the
older files in newer blenders. This also means all HSV/HSL is considered
to be "linear" in the shading nodes.

Would be ported to 2.73 final.
This commit is contained in:
Sergey Sharybin 2014-12-29 18:14:08 +05:00
parent f392f56397
commit c5927cd977
3 changed files with 4 additions and 6 deletions

@ -15,7 +15,6 @@
*/
#include "stdosl.h"
#include "node_color.h"
shader node_combine_hsv(
float H = 0.0,
@ -23,6 +22,6 @@ shader node_combine_hsv(
float V = 0.0,
output color Color = 0.8)
{
Color = color_srgb_to_scene_linear(color("hsv", H, S, V));
Color = color("hsv", H, S, V);
}

@ -23,7 +23,7 @@ shader node_separate_hsv(
output float S = 0.0,
output float V = 0.0)
{
color col = rgb_to_hsv(color_scene_linear_to_srgb(Color));
color col = rgb_to_hsv(Color);
H = col[0];
S = col[1];

@ -26,8 +26,7 @@ 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 = color_srgb_to_scene_linear(
hsv_to_rgb(make_float3(hue, saturation, value)));
float3 color = hsv_to_rgb(make_float3(hue, saturation, value));
if (stack_valid(color_out))
stack_store_float3(stack, color_out, color);
@ -41,7 +40,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_scene_linear_to_srgb(color));
color = rgb_to_hsv(color);
if (stack_valid(hue_out))
stack_store_float(stack, hue_out, color.x);