diff --git a/shaders/cAutoExposureBloom.fx b/shaders/cAutoExposureBloom.fx index 9a5f2e0..3174278 100644 --- a/shaders/cAutoExposureBloom.fx +++ b/shaders/cAutoExposureBloom.fx @@ -17,6 +17,10 @@ #define ENABLE_AUTOEXPOSURE 1 #endif +#ifndef ENABLE_GRADING + #define ENABLE_GRADING 1 +#endif + // Bloom-specific settings #if ENABLE_BLOOM uniform int _BloomRenderMode < @@ -91,159 +95,161 @@ > = false; #endif -uniform float _GradeLightness < - ui_category = "Color Grading | Color Adjustments"; - ui_label = "Lightness"; - ui_type = "drag"; -> = 0.0; - -uniform float _GradeSaturation < - ui_category = "Color Grading | Color Adjustments"; - ui_label = "Saturation"; - ui_type = "slider"; - ui_min = -1.0; - ui_max = 1.0; -> = 0.0; - -uniform float _GradeHueShift < - ui_category = "Color Grading | Color Adjustments"; - ui_label = "Hue"; - ui_type = "slider"; - ui_min = -1.0; - ui_max = 1.0; -> = 0.0; - -uniform float _GradeContrast < - ui_category = "Color Grading | Color Adjustments"; - ui_label = "Contrast"; - ui_type = "slider"; - ui_min = -1.0; - ui_max = 1.0; -> = 0.0; - -uniform float3 _GradeColorFilter < - ui_category = "Color Grading | Color Adjustments"; - ui_label = "Color Filter"; - ui_type = "color"; - ui_min = 0.0; - ui_max = 1.0; -> = 1.0; - -uniform float _GradeTemperature < - ui_category = "Color Grading | White Balance"; - ui_label = "Temperature"; - ui_type = "slider"; - ui_min = -1.0; - ui_max = 1.0; -> = 0.0; - -uniform float _GradeTint < - ui_category = "Color Grading | White Balance"; - ui_label = "Tint"; - ui_type = "slider"; - ui_min = -1.0; - ui_max = 1.0; -> = 0.0; - -uniform float3 _GradeShadows < - ui_category = "Color Grading | Split Toning"; - ui_label = "Shadows"; - ui_type = "color"; -> = float3(0.5, 0.5, 0.5); - -uniform float3 _GradeHighLights < - ui_category = "Color Grading | Split Toning"; - ui_label = "Highlights"; - ui_type = "color"; -> = float3(0.5, 0.5, 0.5); - -uniform float _GradeBalance < - ui_category = "Color Grading | Split Toning"; - ui_label = "Balance"; - ui_type = "slider"; - ui_min = -1.0; - ui_max = 1.0; -> = 0.0; - -uniform float3 _GradeMixRed < - ui_category = "Color Grading | Channel Mixer"; - ui_label = "Red"; - ui_type = "color"; - ui_min = 0.0; - ui_max = 1.0; -> = float3(1.0, 0.0, 0.0); - -uniform float3 _GradeMixGreen < - ui_category = "Color Grading | Channel Mixer"; - ui_label = "Green"; - ui_type = "color"; - ui_min = 0.0; - ui_max = 1.0; -> = float3(0.0, 1.0, 0.0); - -uniform float3 _GradeMixBlue < - ui_category = "Color Grading | Channel Mixer"; - ui_label = "Blue"; - ui_type = "color"; - ui_min = 0.0; - ui_max = 1.0; -> = float3(0.0, 0.0, 1.0); - -uniform float3 _GradeMidtoneShadowColor < - ui_category = "Color Grading | Shadows, Midtones, Hightlights"; - ui_label = "Shadow Color"; - ui_type = "color"; - ui_min = 0.0; - ui_max = 1.0; -> = float3(1.0, 1.0, 1.0); - -uniform float3 _GradeMidtoneColor < - ui_category = "Color Grading | Shadows, Midtones, Hightlights"; - ui_label = "Midtone Color"; - ui_type = "color"; - ui_min = 0.0; - ui_max = 1.0; -> = float3(1.0, 1.0, 1.0); - -uniform float3 _GradeMidtoneHighlightColor < - ui_category = "Color Grading | Shadows, Midtones, Hightlights"; - ui_label = "Highlight Color"; - ui_type = "color"; - ui_min = 0.0; - ui_max = 1.0; -> = float3(1.0, 1.0, 1.0); - -uniform float _GradeMidtoneShadowStart < - ui_category = "Color Grading | Shadows, Midtones, Hightlights"; - ui_label = "Shadows Start"; - ui_type = "slider"; - ui_min = 0.0; - ui_max = 1.0; -> = 0.0; - -uniform float _GradeMidtoneShadowEnd < - ui_category = "Color Grading | Shadows, Midtones, Hightlights"; - ui_label = "Shadows End"; - ui_type = "slider"; - ui_min = 0.0; - ui_max = 1.0; -> = 0.3; - -uniform float _GradeMidtoneHighlightStart < - ui_category = "Color Grading | Shadows, Midtones, Hightlights"; - ui_label = "Highlights Start"; - ui_type = "slider"; - ui_min = 0.0; - ui_max = 1.0; -> = 0.55; - -uniform float _GradeMidtoneHighlightEnd < - ui_category = "Color Grading | Shadows, Midtones, Hightlights"; - ui_label = "Highlights End"; - ui_type = "slider"; - ui_min = 0.0; - ui_max = 1.0; -> = 1.0; +#if ENABLE_GRADING + uniform float _GradeLightness < + ui_category = "Color Grading | Color Adjustments"; + ui_label = "Lightness"; + ui_type = "drag"; + > = 0.0; + + uniform float _GradeSaturation < + ui_category = "Color Grading | Color Adjustments"; + ui_label = "Saturation"; + ui_type = "slider"; + ui_min = -1.0; + ui_max = 1.0; + > = 0.0; + + uniform float _GradeHueShift < + ui_category = "Color Grading | Color Adjustments"; + ui_label = "Hue"; + ui_type = "slider"; + ui_min = -1.0; + ui_max = 1.0; + > = 0.0; + + uniform float _GradeContrast < + ui_category = "Color Grading | Color Adjustments"; + ui_label = "Contrast"; + ui_type = "slider"; + ui_min = -1.0; + ui_max = 1.0; + > = 0.0; + + uniform float3 _GradeColorFilter < + ui_category = "Color Grading | Color Adjustments"; + ui_label = "Color Filter"; + ui_type = "color"; + ui_min = 0.0; + ui_max = 1.0; + > = 1.0; + + uniform float _GradeTemperature < + ui_category = "Color Grading | White Balance"; + ui_label = "Temperature"; + ui_type = "slider"; + ui_min = -1.0; + ui_max = 1.0; + > = 0.0; + + uniform float _GradeTint < + ui_category = "Color Grading | White Balance"; + ui_label = "Tint"; + ui_type = "slider"; + ui_min = -1.0; + ui_max = 1.0; + > = 0.0; + + uniform float3 _GradeShadows < + ui_category = "Color Grading | Split Toning"; + ui_label = "Shadows"; + ui_type = "color"; + > = float3(0.5, 0.5, 0.5); + + uniform float3 _GradeHighLights < + ui_category = "Color Grading | Split Toning"; + ui_label = "Highlights"; + ui_type = "color"; + > = float3(0.5, 0.5, 0.5); + + uniform float _GradeBalance < + ui_category = "Color Grading | Split Toning"; + ui_label = "Balance"; + ui_type = "slider"; + ui_min = -1.0; + ui_max = 1.0; + > = 0.0; + + uniform float3 _GradeMixRed < + ui_category = "Color Grading | Channel Mixer"; + ui_label = "Red"; + ui_type = "color"; + ui_min = 0.0; + ui_max = 1.0; + > = float3(1.0, 0.0, 0.0); + + uniform float3 _GradeMixGreen < + ui_category = "Color Grading | Channel Mixer"; + ui_label = "Green"; + ui_type = "color"; + ui_min = 0.0; + ui_max = 1.0; + > = float3(0.0, 1.0, 0.0); + + uniform float3 _GradeMixBlue < + ui_category = "Color Grading | Channel Mixer"; + ui_label = "Blue"; + ui_type = "color"; + ui_min = 0.0; + ui_max = 1.0; + > = float3(0.0, 0.0, 1.0); + + uniform float3 _GradeMidtoneShadowColor < + ui_category = "Color Grading | Shadows, Midtones, Hightlights"; + ui_label = "Shadow Color"; + ui_type = "color"; + ui_min = 0.0; + ui_max = 1.0; + > = float3(1.0, 1.0, 1.0); + + uniform float3 _GradeMidtoneColor < + ui_category = "Color Grading | Shadows, Midtones, Hightlights"; + ui_label = "Midtone Color"; + ui_type = "color"; + ui_min = 0.0; + ui_max = 1.0; + > = float3(1.0, 1.0, 1.0); + + uniform float3 _GradeMidtoneHighlightColor < + ui_category = "Color Grading | Shadows, Midtones, Hightlights"; + ui_label = "Highlight Color"; + ui_type = "color"; + ui_min = 0.0; + ui_max = 1.0; + > = float3(1.0, 1.0, 1.0); + + uniform float _GradeMidtoneShadowStart < + ui_category = "Color Grading | Shadows, Midtones, Hightlights"; + ui_label = "Shadows Start"; + ui_type = "slider"; + ui_min = 0.0; + ui_max = 1.0; + > = 0.0; + + uniform float _GradeMidtoneShadowEnd < + ui_category = "Color Grading | Shadows, Midtones, Hightlights"; + ui_label = "Shadows End"; + ui_type = "slider"; + ui_min = 0.0; + ui_max = 1.0; + > = 0.3; + + uniform float _GradeMidtoneHighlightStart < + ui_category = "Color Grading | Shadows, Midtones, Hightlights"; + ui_label = "Highlights Start"; + ui_type = "slider"; + ui_min = 0.0; + ui_max = 1.0; + > = 0.55; + + uniform float _GradeMidtoneHighlightEnd < + ui_category = "Color Grading | Shadows, Midtones, Hightlights"; + ui_label = "Highlights End"; + ui_type = "slider"; + ui_min = 0.0; + ui_max = 1.0; + > = 1.0; +#endif #include "shared/cShadeHDR.fxh" #if ENABLE_AUTOEXPOSURE @@ -490,30 +496,32 @@ float4 PS_Composite(CShade_VS2PS_Quad Input) : SV_TARGET0 : BloomColor; #endif - // Apply color-grading - CColor_ApplyColorGrading( - BaseColor, - _GradeLightness, - _GradeHueShift, - _GradeSaturation, - _GradeContrast, - _GradeColorFilter, - _GradeTemperature, - _GradeTint, - _GradeShadows, - _GradeHighLights, - _GradeBalance, - _GradeMixRed, - _GradeMixGreen, - _GradeMixBlue, - _GradeMidtoneShadowColor, - _GradeMidtoneColor, - _GradeMidtoneHighlightColor, - _GradeMidtoneShadowStart, - _GradeMidtoneShadowEnd, - _GradeMidtoneHighlightStart, - _GradeMidtoneHighlightEnd - ); + #if ENABLE_GRADING + // Apply color-grading + CColor_ApplyColorGrading( + BaseColor, + _GradeLightness, + _GradeHueShift, + _GradeSaturation, + _GradeContrast, + _GradeColorFilter, + _GradeTemperature, + _GradeTint, + _GradeShadows, + _GradeHighLights, + _GradeBalance, + _GradeMixRed, + _GradeMixGreen, + _GradeMixBlue, + _GradeMidtoneShadowColor, + _GradeMidtoneColor, + _GradeMidtoneHighlightColor, + _GradeMidtoneShadowStart, + _GradeMidtoneShadowEnd, + _GradeMidtoneHighlightStart, + _GradeMidtoneHighlightEnd + ); + #endif // Apply tonemapping BaseColor = CTonemap_ApplyOutputTonemap(BaseColor);