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/blender/nodes/shader | |
parent | b54b14582bbd65103b5b052168dd8353e261d2ea (diff) | |
parent | ec559912fbcb51b713e1f33d4931af5fb52fd85b (diff) |
Merge branch 'blender2.7'
Diffstat (limited to 'source/blender/nodes/shader')
-rw-r--r-- | source/blender/nodes/shader/nodes/node_shader_hueSatVal.c | 5 |
1 files changed, 2 insertions, 3 deletions
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); |