Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/nodes')
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_hueSatVal.c5
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);