Fix T61470: inconsistent HSV node results with saturation > 1.0.
Values outside the 0..1 range produce negative colors, so now clamp to that range everywhere. Also fixes improper handling of hue > 2.0 in some places.
This commit is contained in:
@@ -28,9 +28,8 @@ shader node_hsv(
|
||||
color Color = rgb_to_hsv(ColorIn);
|
||||
|
||||
// remember: fmod doesn't work for negative numbers
|
||||
Color[0] += Hue + 0.5;
|
||||
Color[0] = fmod(Color[0], 1.0);
|
||||
Color[1] *= Saturation;
|
||||
Color[0] = fmod(Color[0] + Hue + 0.5, 1.0);
|
||||
Color[1] *= clamp(Saturation, 0.0, 1.0);
|
||||
Color[2] *= Value;
|
||||
|
||||
Color = hsv_to_rgb(Color);
|
||||
|
Reference in New Issue
Block a user