diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-02-13 21:02:43 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-02-13 21:02:43 +0300 |
commit | dbd9b7590af7a3dde3805bf23f78a6e0c6b1fe99 (patch) | |
tree | 8aa4b73de65bd84d91495abc3ece0e017e17cdfb /source | |
parent | b54b14582bbd65103b5b052168dd8353e261d2ea (diff) | |
parent | ec559912fbcb51b713e1f33d4931af5fb52fd85b (diff) |
Merge branch 'blender2.7'
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_material.glsl | 4 | ||||
-rw-r--r-- | source/blender/nodes/shader/nodes/node_shader_hueSatVal.c | 5 |
2 files changed, 4 insertions, 5 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl index 13b98080feb..d5bb157867b 100644 --- a/source/blender/gpu/shaders/gpu_shader_material.glsl +++ b/source/blender/gpu/shaders/gpu_shader_material.glsl @@ -856,8 +856,8 @@ void hue_sat(float hue, float sat, float value, float fac, vec4 col, out vec4 ou rgb_to_hsv(col, hsv); - hsv[0] = fract(hsv[0] + (hue - 0.5)); - hsv[1] = clamp(hsv[1] * sat, 0.0, 1.0); + hsv[0] = fract(hsv[0] + hue + 0.5); + hsv[1] = hsv[1] * clamp(sat, 0.0, 1.0); hsv[2] = hsv[2] * value; hsv_to_rgb(hsv, outcol); diff --git a/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c b/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c index f30872cc328..af802e988bb 100644 --- a/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c +++ b/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c @@ -45,9 +45,8 @@ static void do_hue_sat_fac(bNode *UNUSED(node), float *out, float hue, float sat float col[3], hsv[3], mfac = 1.0f - fac; rgb_to_hsv(in[0], in[1], in[2], hsv, hsv + 1, hsv + 2); - hsv[0] += (hue - 0.5f); - if (hsv[0] > 1.0f) hsv[0] -= 1.0f; else if (hsv[0] < 0.0f) hsv[0] += 1.0f; - hsv[1] *= sat; + hsv[0] = fmodf(hsv[0] + hue + 0.5f, 1.0f); + hsv[1] *= clamp_f(sat, 0.0f, 1.0f); hsv[2] *= val; hsv_to_rgb(hsv[0], hsv[1], hsv[2], col, col + 1, col + 2); |