Fix #107583: HSV node gives differ from CPU compositor
The HSV node in the realtime compositor produces different values from the CPU compositor in its identity settings. This happens because the realtime compositor clamped the saturation value after HSV correction, while the CPU compositor did not, so this patch unifies that behavior. Additionally, negative values are now clamped in both the HSV node and Hue correction node to also match the CPU compositor.
This commit is contained in:
@@ -34,6 +34,7 @@ void node_composite_hue_correct(float factor,
|
||||
hsv.y = clamp(hsv.y, 0.0, 1.0);
|
||||
|
||||
hsv_to_rgb(hsv, result);
|
||||
result.rgb = max(result.rgb, vec3(0.0));
|
||||
|
||||
result = mix(color, result, factor);
|
||||
}
|
||||
|
||||
@@ -7,10 +7,11 @@ void node_composite_hue_saturation_value(
|
||||
rgb_to_hsv(color, hsv);
|
||||
|
||||
hsv.x = fract(hsv.x + hue + 0.5);
|
||||
hsv.y = clamp(hsv.y * saturation, 0.0, 1.0);
|
||||
hsv.y = hsv.y * saturation;
|
||||
hsv.z = hsv.z * value;
|
||||
|
||||
hsv_to_rgb(hsv, result);
|
||||
result.rgb = max(result.rgb, vec3(0.0));
|
||||
|
||||
result = mix(color, result, factor);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user