diff options
-rw-r--r-- | intern/cycles/kernel/osl/nodes/node_hsv.osl | 3 | ||||
-rw-r--r-- | intern/cycles/kernel/svm/svm_hsv.h | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/intern/cycles/kernel/osl/nodes/node_hsv.osl b/intern/cycles/kernel/osl/nodes/node_hsv.osl index da776c8909e..8fd7a1612e8 100644 --- a/intern/cycles/kernel/osl/nodes/node_hsv.osl +++ b/intern/cycles/kernel/osl/nodes/node_hsv.osl @@ -30,7 +30,8 @@ shader node_hsv( float t = clamp(Fac, 0.0, 1.0); color Color = rgb_to_hsv(ColorIn); - Color[0] += Hue - 0.5; + // remember: fmod doesn't work for negative numbers + Color[0] += Hue + 0.5; Color[0] = fmod(Color[0], 1.0); Color[1] *= Saturation; Color[2] *= Value; diff --git a/intern/cycles/kernel/svm/svm_hsv.h b/intern/cycles/kernel/svm/svm_hsv.h index fc927f297f5..ed17d3fc985 100644 --- a/intern/cycles/kernel/svm/svm_hsv.h +++ b/intern/cycles/kernel/svm/svm_hsv.h @@ -110,7 +110,8 @@ __device void svm_node_hsv(KernelGlobals *kg, ShaderData *sd, float *stack, uint color = rgb_to_hsv(color); - color.x += hue - 0.5f; + // remember: fmod doesn't work for negative numbers + color.x += hue + 0.5f; color.x = fmod(color.x, 1.0f); color.y *= sat; color.z *= val; |