From e129f2a0fa2d6debae39003ab3aa81acf1c40a41 Mon Sep 17 00:00:00 2001 From: papadanku Date: Sat, 26 Oct 2024 01:41:23 -0700 Subject: [PATCH] Cleanups --- shaders/cRaySchism.fx | 18 +++++++++--------- shaders/shared/cColor.fxh | 15 ++++++++------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/shaders/cRaySchism.fx b/shaders/cRaySchism.fx index 0e99df4..a003468 100644 --- a/shaders/cRaySchism.fx +++ b/shaders/cRaySchism.fx @@ -101,18 +101,10 @@ uniform float _GradeLightness < ui_category = "Color Grading | Color Adjustments"; - ui_label = "Post Lightness Bias"; + ui_label = "Lightness"; ui_type = "drag"; > = 0.0; -uniform float _GradeHueShift < - ui_category = "Color Grading | Color Adjustments"; - ui_label = "Hue Shift"; - ui_type = "slider"; - ui_min = -180.0; - ui_max = 180.0; -> = 0.0; - uniform float _GradeSaturation < ui_category = "Color Grading | Color Adjustments"; ui_label = "Saturation"; @@ -121,6 +113,14 @@ uniform float _GradeSaturation < ui_max = 1.0; > = 0.0; +uniform float _GradeHueShift < + ui_category = "Color Grading | Color Adjustments"; + ui_label = "Hue"; + ui_type = "slider"; + ui_min = -180.0; + ui_max = 180.0; +> = 0.0; + uniform float _GradeContrast < ui_category = "Color Grading | Color Adjustments"; ui_label = "Contrast"; diff --git a/shaders/shared/cColor.fxh b/shaders/shared/cColor.fxh index 72dd5b3..5c2a5e0 100644 --- a/shaders/shared/cColor.fxh +++ b/shaders/shared/cColor.fxh @@ -552,18 +552,16 @@ // Convert user-friendly uniform settings float3x3 ChannelMixMat = float3x3(MixRed, MixGreen, MixBlue); - Contrast += 1.0; - HueShift = (HueShift / 360.0) * CMath_GetPi(); + Lightness += 1.0; Saturation += 1.0; + HueShift = (HueShift / 360.0) * CMath_GetPi(); + Contrast += 1.0; Temperature /= 10.0; Tint /= 10.0; // Convert RGB to OKLab Color = CColor_GetOKLABfromRGB(Color); - // Apply lightness bias - Color.x += Lightness; - // Apply temperature shift Color.z += Temperature; @@ -573,12 +571,15 @@ // Convert OKLab to OKLch Color = CColor_GetOKLCHfromOKLAB(Color, false); - // Apply hue shift - Color.z += HueShift; + // Apply lightness + Color.x *= Lightness; // Apply saturation Color.y *= Saturation; + // Apply hue shift + Color.z += HueShift; + // Convert OKLch to RGB Color = CColor_GetRGBfromOKLCH(Color);