diff --git a/Enhancement/Splatoon_FX/362996925fba8945_0000000000001e51_ps.txt b/Enhancement/Splatoon_FX/362996925fba8945_0000000000001e51_ps.txt deleted file mode 100644 index 67f35a79..00000000 --- a/Enhancement/Splatoon_FX/362996925fba8945_0000000000001e51_ps.txt +++ /dev/null @@ -1,678 +0,0 @@ -#version 420 -#extension GL_ARB_texture_gather : enable -#extension GL_ARB_separate_shader_objects : enable -// shader 362996925fba8945 -// SplatFx - -#define adjust_bloom 0 // 0: disable, 1: enable. -// BloomFactor -const float bloomFactor = 1.0; // Default is 1.0 -#define HDRpassing 1 // 0: disable, 1: enable. -// Fake High Dynamic Range. -const float HDRPower = 1.30; // 0.0 to 8.0 Default 1.30. -const float radius1 = 0.793; // 0.0 to 8.0 Default 0.793 -const float radius2 = 0.87; // 0.0 to 8.0 Default 0.87 "Raising this seems to make the effect stronger and also brighter." - -#define lumapassing 1 // 0: disable, 1: enable. -// LumaShapening -const float sharp_strength = 0.65; //[0.10 to 3.00] Strength of the sharpening Default is 0.65 -const float sharp_clamp = 0.085; //[0.000 to 1.000] Limits maximum amount of sharpening a pixel recieves - Default is 0.035 - - //Advanced sharpening settings -const float offset_bias = 1.0; //[0.0 to 6.0] Offset bias adjusts the radius of the sampling pattern. - -#define Tone_map 0 // 0: disable, 1-8: enable. - // Reshade ToneMap Option 1 - // linearToneMapping Option 2 - // simpleReinhardToneMapping Option 3 - // lumaBasedReinhardToneMapping Option 4 - // whitePreservingLumaBasedReinhardToneMapping Option 5 - // RomBinDaHouseToneMapping Option 6 - // filmicToneMapping Option 7 - // Uncharted2ToneMapping Option 8 - // ACES Filmic Option 9 - // Reshade ToneMap Controls -const float Exposure = 0.6; // [0.0, 1.0+] Adjust exposure -const float Bleach = 0.00; // "More bleach means more contrasted and less colorful image" min -0.5 max 1.0 Default 0.0 -const float defog = 0.004; // Default is 0.0 //How much of the overall color you want removed form the values of FogColor. -vec3 FogColor = vec3(1.0, 1.5, 1.7); // Color you want to Add or Remove 0.25 would add .25 percent of that color 1.25 would remove .25 percent of the color." -const float sat = 0.050; // "Adjust saturation" min -1.0 max 1.0 Default 0.0 - -#define blacknwhitepass 0 // 0: disable, 1: enable. -// Levels Control -const int BlackPoint = 16; // [0, 255] The black point is the new black - literally. Everything darker than this will become completely black -const int WhitePoint = 235; // [0, 255] The new white point. Everything brighter than this becomes completely white - -#define lggpass 0 // 0: disable, 1: enable. -// Lift Gamma Gain -vec3 RGB_Lift = vec3( 1.000, 1.000, 1.000); // [0.000 to 2.000] Adjust shadows for Red, Green and Blue. -vec3 RGB_Gamma = vec3( 1.000, 1.00, 1.000); // [0.000 to 2.000] Adjust midtones for Red, Green and Blue -vec3 RGB_Gain = vec3( 1.000, 1.000, 1.000); // [0.000 to 2.000] Adjust highlights for Red, Green and Blue -// Note that a value of 1.0 is a neutral setting that leave the color unchanged. - -#define vibpass 0 // 0: disable, 1: enable. -// VibrancePass -uniform float Vibrance = 1.000; // "Intelligently saturates (or desaturates if you use negative values) the pixels depending on their original saturation."; -vec3 VibranceRGBBalance = vec3(1.00, 1.0, 1.0); // "A per channel multiplier to the Vibrance strength so you can give more boost to certain colors over others."; - -#define Tech 0 -// Technicolor -const float Power = 4.0; // Min 0.0 Max 8.0 Default 4.0 -vec3 RGBNegativeAmount = vec3(0.88, 0.88, 0.88); -// To Edit Strength scroll down to Techicolor and edit it there, to not conflict with Filmic - -#define Techine 0 // 0: disable, 1: enable. -// Technicolor2 -const float Technicolor2_Red_Strength = 0.0; // "Higher means darker and more intense colors." Default 0.2 -const float Technicolor2_Green_Strength = 0.0; // "Higher means darker and more intense colors." Default 0.2 -const float Technicolor2_Blue_Strength = 0.0; // "Higher means darker and more intense colors." Default 0.2 -const float Technicolor2_Brightness = 0.0; // "Higher means brighter image." min 0.5 max 1.5 Default 1.0 -const float Technicolor2_Strength = 0.0; // Default is 1.0 -const float Technicolor2_Saturation = 1.00; // Default is 1.0 - -// Curves / Filmic Pass Contrast -#define CurvesPss 1 // 0: disable, 1: enable. -const float Contrast = 0.750; -// 1 To use curves Contrast, 0 off or to use with Filmic Pass. - -#define Filmicpass 0 // 0: disable, 1: enable. -// Filmic Pass -const float Strength = 0.85; // "Strength of the color curve altering"; min 0.0 max 1.5 Default 0.85 -const float Fade = 0.5; // "Decreases contrast to imitate faded image" min 0.0 max 0.6 Default 0.4 -const float Linearization = 0.75; // min 0.5 max 2.0 Default 0.5 -const float Saturation = -0.15; // min -1.0 max 1.0 Default -0.15 - -const float RedCurve = 1.0; // min 0.0 max 2.0 Default 1.0 -const float GreenCurve = 1.0; // min 0.0 max 2.0 Default 1.0 -const float BlueCurve = 1.0; // min 0.0 max 2.0 Default 1.0 -const float BaseCurve = 1.5; // min 0.0 max 2.0 Default 1.5 - -const float BaseGamma = 1.0; // min 0.7 max 2.0 Default 1.0 -const float EffectGamma = 0.68; // min 0.0 max 2.0 Default 0.68 -const float EffectGammaR = 1.0; // min 0.0 max 2.0 Default 1.0 -const float EffectGammaG = 1.0; // min 0.0 max 2.0 Default 1.0 -const float EffectGammaB = 1.0; // min 0.0 max 2.0 Default 1.0 - -//########################################################### -// Do not edit under this line. -uniform ivec4 uf_remappedPS[1]; -layout(binding = 0) uniform sampler2D textureUnitPS0;// Tex0 addr 0xf494a800 res 320x180x1 dim 1 tm: 4 format 0816 compSel: 0 1 2 5 mipView: 0x0 (num 0x5) sliceView: 0x0 (num 0x1) Sampler0 ClampX/Y/Z: 2 2 2 border: 1 -layout(binding = 1) uniform sampler3D textureUnitPS1;// Tex1 addr 0x1eb61800 res 8x8x8 dim 2 tm: 3 format 0816 compSel: 0 1 2 5 mipView: 0x0 (num 0x1) sliceView: 0x0 (num 0x8) Sampler1 ClampX/Y/Z: 2 2 2 border: 1 -layout(binding = 2) uniform sampler2D textureUnitPS2;// Tex2 addr 0xf45c6000 res 1280x720x1 dim 1 tm: 4 format 0816 compSel: 0 1 2 5 mipView: 0x0 (num 0x1) sliceView: 0x0 (num 0x1) Sampler2 ClampX/Y/Z: 2 2 2 border: 1 -layout(location = 0) in vec4 passParameterSem0; -layout(location = 1) in vec4 passParameterSem1; -layout(location = 0) out vec4 passPixelColor0; -uniform vec2 uf_fragCoordScale; -int clampFI32(int v) -{ -if( v == 0x7FFFFFFF ) - return floatBitsToInt(1.0); -else if( v == 0xFFFFFFFF ) - return floatBitsToInt(0.0); -return floatBitsToInt(clamp(intBitsToFloat(v), 0.0, 1.0)); -} -float mul_nonIEEE(float a, float b){ if( a == 0.0 || b == 0.0 ) return 0.0; return a*b; } - -// ToneMapping - -vec3 linearToneMapping(vec3 color) -{ - float exposure = 1.; - color = clamp(exposure * color, 0., 1.); - return color; -} - -vec3 simpleReinhardToneMapping(vec3 color) -{ - float exposure = 1.5; - color *= exposure / (1. + color / exposure); - return color; -} - -vec3 lumaBasedReinhardToneMapping(vec3 color) -{ - float luma = dot(color, vec3(0.2126, 0.7152, 0.0722)); - float toneMappedLuma = luma / (1. + luma); - color *= toneMappedLuma / luma; - return color; -} - -vec3 whitePreservingLumaBasedReinhardToneMapping(vec3 color) -{ - float white = 2.; - float luma = dot(color, vec3(0.2126, 0.7152, 0.0722)); - float toneMappedLuma = luma * (1. + luma / (white*white)) / (1. + luma); - color *= toneMappedLuma / luma; - return color; -} - -vec3 RomBinDaHouseToneMapping(vec3 color) -{ - color = exp(-1.0 / (2.72*color + 0.15)); - return color; -} - -vec3 filmicToneMapping(vec3 color) -{ - color = max(vec3(0.), color - vec3(0.004)); - color = (color * (6.2 * color + .5)) / (color * (6.2 * color + 1.7) + 0.06); - return color; -} - -vec3 Uncharted2ToneMapping(vec3 color) -{ - float A = 0.15; - float B = 0.50; - float C = 0.10; - float D = 0.20; - float E = 0.02; - float F = 0.30; - float W = 11.2; - float exposure = 2.; - color *= exposure; - color = ((color * (A * color + C * B) + D * E) / (color * (A * color + B) + D * F)) - E / F; - float white = ((W * (A * W + C * B) + D * E) / (W * (A * W + B) + D * F)) - E / F; - color /= white; - return color; -} - -vec3 ReshadeToneMap(vec3 inputColor) { - vec3 color = inputColor; - color = clamp(color - defog * FogColor * 2.55, 0.0, 1.0); // defog - - const vec3 coefLuma = vec3(0.2126, 0.7152, 0.0722); - float lum = dot(coefLuma, color); - - float L = clamp(10.0 * (lum - 0.45), 0.0, 1.0); - vec3 A2 = Bleach * color; - - vec3 result1 = 2.0f * color * lum; - vec3 result2 = 1.0f - 2.0f * (1.0f - lum) * (1.0f - color); - - vec3 newColor = mix(result1, result2, L); - vec3 mixRGB = A2 * newColor; - color += ((1.0f - A2) * mixRGB); - - vec3 middlegray = vec3(dot(color, vec3(1.0 / 3.0))); - vec3 diffcolor = color - middlegray; - - color = (color + diffcolor * sat) / (1 + (diffcolor * sat)); // saturation - - return color; -} -float getL709(vec3 rgb) { - return dot(rgb, vec3(0.2126, 0.7152, 0.0722)); -} -vec3 ACESFilm(vec3 color) { - color *= Exposure; - float Lumn = getL709(color); - vec4 tm = vec4(color, Lumn); - tm = (tm*(2.51*tm + 0.03)) / (tm*(2.43*tm + 0.59) + 0.14); // tonemap - vec3 cpre = tm.w / Lumn * color; - vec3 colorldr = mix(cpre, tm.rgb, vec3(pow(tm.w, 2.0)));//refine - return colorldr; -} - -// Curves - -vec3 CurvesPass(vec3 inputColor) { - vec3 colorInput = inputColor; - float Contrast_blend = Contrast * 2.0; //I multiply by two to give it a strength closer to the other curves. - vec3 x = colorInput.rgb; //if the curve should be applied to both Luma and Chroma - x = x * (x * (1.5 - x) + 0.5); //horner form - fastest version - vec3 color = x; //if the curve should be applied to both Luma and Chroma - colorInput.rgb = mix(colorInput.rgb, color, Contrast_blend); //Blend by Contrast - return colorInput; -} - -// TECHNICOLOR2 - -vec3 Technicolor2(vec3 inputColor) { - vec3 color = inputColor; - vec3 Color_Strength = vec3(Technicolor2_Red_Strength, Technicolor2_Green_Strength, Technicolor2_Blue_Strength); - vec3 source = color; - vec3 temp = 1.0 - source; - vec3 target = temp.grg; - vec3 target2 = temp.bbr; - vec3 temp2 = source * target; - temp2 *= target2; - - temp = temp2 * Color_Strength; - temp2 *= Technicolor2_Brightness; - - target = temp.grg; - target2 = temp.bbr; - - temp = source - target; - temp += temp2; - temp2 = temp - target2; - - color = mix(source, temp2, Technicolor2_Strength); - - color = mix(vec3(dot(color, vec3(0.333))), color, Technicolor2_Saturation); - - return color; -} - -// Technicolor -vec3 TechnicolorPass(vec3 color) -{ - float Strength = 0.20; // Min 0.0 Max 1.0 Default 0.4 - const vec3 cyanfilter = vec3(0.0, 1.30, 1.0); - const vec3 magentafilter = vec3(1.0, 0.0, 1.05); - const vec3 yellowfilter = vec3(1.6, 1.6, 0.05); - const vec2 redorangefilter = vec2(1.05, 0.620); // RG_ - const vec2 greenfilter = vec2(0.30, 1.0); // RG_ - const vec2 magentafilter2 = magentafilter.rb; // R_B - - vec3 tcol = color.rgb; - - vec2 negative_mul_r = tcol.rg * (1.0 / (RGBNegativeAmount.r * Power)); - vec2 negative_mul_g = tcol.rg * (1.0 / (RGBNegativeAmount.g * Power)); - vec2 negative_mul_b = tcol.rb * (1.0 / (RGBNegativeAmount.b * Power)); - vec3 output_r = dot(redorangefilter, negative_mul_r).xxx + cyanfilter; - vec3 output_g = dot(greenfilter, negative_mul_g).xxx + magentafilter; - vec3 output_b = dot(magentafilter2, negative_mul_b).xxx + yellowfilter; - - return mix(tcol, output_r * output_g * output_b, Strength); -} - -// Levels - -vec3 LevelsPass(vec3 inputColor) { - float black_point_float = BlackPoint / 255.0; - float white_point_float = WhitePoint == BlackPoint ? (255.0 / 0.00025) : (255.0 / (WhitePoint - BlackPoint)); // Avoid division by zero if the white and black point are the same - - vec3 color = inputColor; - color = color * white_point_float - (black_point_float * white_point_float); - - return color; -} - -// FilmPass -vec3 FilmPass(vec3 inputColor) { - - vec3 B = inputColor.rgb; - vec3 G = B; - vec3 H = vec3(0.01); - - B = clamp(B, 0.0, 1.); - B = pow(vec3(B), vec3(Linearization)); - B = mix(H, B, Contrast); - - vec3 LumCoeff = vec3(0.212656, 0.715158, 0.072186); - float A = dot(B.rgb, LumCoeff); - vec3 D = vec3(A); - - B = pow(B, 1.0 / vec3(BaseGamma)); - - float a = RedCurve; - float b = GreenCurve; - float c = BlueCurve; - float d = BaseCurve; - - float y = 1.0 / (1.0 + exp(a / 2.0)); - float z = 1.0 / (1.0 + exp(b / 2.0)); - float w = 1.0 / (1.0 + exp(c / 2.0)); - float v = 1.0 / (1.0 + exp(d / 2.0)); - - vec3 C = B; - - D.r = (1.0 / (1.0 + exp(-a * (D.r - 0.5))) - y) / (1.0 - 2.0 * y); - D.g = (1.0 / (1.0 + exp(-b * (D.g - 0.5))) - z) / (1.0 - 2.0 * z); - D.b = (1.0 / (1.0 + exp(-c * (D.b - 0.5))) - w) / (1.0 - 2.0 * w); - - D = pow(D, 1.0 / vec3(EffectGamma)); - - vec3 Di = 1.0 - D; - - D = mix(D, Di, Bleach); - - D.r = pow(abs(D.r), 1.0 / EffectGammaR); - D.g = pow(abs(D.g), 1.0 / EffectGammaG); - D.b = pow(abs(D.b), 1.0 / EffectGammaB); - - if (D.r < 0.5) - C.r = (2.0 * D.r - 1.0) * (B.r - B.r * B.r) + B.r; - else - C.r = (2.0 * D.r - 1.0) * (sqrt(B.r) - B.r) + B.r; - - if (D.g < 0.5) - C.g = (2.0 * D.g - 1.0) * (B.g - B.g * B.g) + B.g; - else - C.g = (2.0 * D.g - 1.0) * (sqrt(B.g) - B.g) + B.g; - - if (D.b < 0.5) - C.b = (2.0 * D.b - 1.0) * (B.b - B.b * B.b) + B.b; - else - C.b = (2.0 * D.b - 1.0) * (sqrt(B.b) - B.b) + B.b; - - vec3 F = mix(B, C, Strength); - - F = (1.0 / (1.0 + exp(-d * (F - 0.5))) - v) / (1.0 - 2.0 * v); - - float r2R = 1.0 - Saturation; - float g2R = 0.0 + Saturation; - float b2R = 0.0 + Saturation; - - float r2G = 0.0 + Saturation; - float g2G = (1.0 - Fade) - Saturation; - float b2G = (0.0 + Fade) + Saturation; - - float r2B = 0.0 + Saturation; - float g2B = (0.0 + Fade) + Saturation; - float b2B = (1.0 - Fade) - Saturation; - - vec3 iF = F; - - F.r = (iF.r * r2R + iF.g * g2R + iF.b * b2R); - F.g = (iF.r * r2G + iF.g * g2G + iF.b * b2G); - F.b = (iF.r * r2B + iF.g * g2B + iF.b * b2B); - - float N = dot(F.rgb, LumCoeff); - vec3 Cn = F; - - if (N < 0.5) - Cn = (2.0 * N - 1.0) * (F - F * F) + F; - else - Cn = (2.0 * N - 1.0) * (sqrt(F) - F) + F; - - Cn = pow(max(Cn, 0), 1.0 / vec3(Linearization)); - - vec3 Fn = mix(B, Cn, Strength); - return Fn; -} - -//Lift Gamma Gain - -vec3 LiftGammaGainPass(vec3 colorInput) -{ - // -- Get input -- - vec3 color = colorInput; - - // -- Lift -- - - color = color * (1.5 - 0.5 * RGB_Lift) + 0.5 * RGB_Lift - 0.5; - color = clamp(color, 0.0, 1.0); //isn't strictly necessary, but doesn't cost performance. - - // -- Gain -- - color *= RGB_Gain; - - // -- Gamma -- - color = pow(color, 1.0 / RGB_Gamma); //Gamma - - // -- Return output -- - return clamp(color, 0.0, 1.0); -} - -//VibrancePass -vec3 VibrancePass(vec3 color) { - - const vec3 coefLuma = vec3(0.2126, 0.7152, 0.0722); - float luma = dot(coefLuma, color); - - float max_color = max(color.r, max(color.g, color.b)); // Find the strongest color - float min_color = min(color.r, min(color.g, color.b)); // Find the weakest color - - float color_saturation = max_color - min_color; // The difference between the two is the saturation - - // Extrapolate between luma and original by 1 + (1-saturation) - current - vec3 coeffVibrance = VibranceRGBBalance * Vibrance; - - color = mix(vec3(luma), color, 1.0 + (coeffVibrance * (1.0 - (sign(coeffVibrance) * color_saturation)))); - - return color; -} - -//LumaShapening - -#define px (1.0/1280.0*uf_fragCoordScale.x) -#define py (1.0/720.0*uf_fragCoordScale.y) -#define CoefLuma vec3(0.2126, 0.7152, 0.0722) - -float lumasharping(sampler2D tex, vec2 pos) { - vec4 colorInput = texture(tex, pos); - - vec3 ori = colorInput.rgb; - - // -- Combining the strength and luma multipliers -- - vec3 sharp_strength_luma = (CoefLuma * sharp_strength); - - // -- Gaussian filter -- - // [ .25, .50, .25] [ 1 , 2 , 1 ] - // [ .50, 1, .50] = [ 2 , 4 , 2 ] - // [ .25, .50, .25] [ 1 , 2 , 1 ] - - vec3 blur_ori = texture(tex, pos + vec2(px, -py) * 0.5 * offset_bias).rgb; // South East - blur_ori += texture(tex, pos + vec2(-px, -py) * 0.5 * offset_bias).rgb; // South West - blur_ori += texture(tex, pos + vec2(px, py) * 0.5 * offset_bias).rgb; // North East - blur_ori += texture(tex, pos + vec2(-px, py) * 0.5 * offset_bias).rgb; // North West - - blur_ori *= 0.25; // ( /= 4) Divide by the number of texture fetches - - // -- Calculate the sharpening -- - vec3 sharp = ori - blur_ori; //Subtracting the blurred image from the original image - - // -- Adjust strength of the sharpening and clamp it-- - vec4 sharp_strength_luma_clamp = vec4(sharp_strength_luma * (0.5 / sharp_clamp), 0.5); //Roll part of the clamp into the dot - - float sharp_luma = clamp((dot(vec4(sharp, 1.0), sharp_strength_luma_clamp)), 0.0, 1.0); //Calculate the luma, adjust the strength, scale up and clamp - sharp_luma = (sharp_clamp * 2.0) * sharp_luma - sharp_clamp; //scale down - - return sharp_luma; -} - -//Fake High Dynamic Range. - -vec3 HDRPass(sampler2D tex, vec2 pos) { - vec3 color = texture(tex, pos).rgb; - - vec3 bloom_sum1 = texture(tex, pos + vec2(1.5, -1.5) * radius1 * vec2(px, py)).rgb; - bloom_sum1 += texture(tex, pos + vec2(-1.5, -1.5) * radius1 * vec2(px, py)).rgb; - bloom_sum1 += texture(tex, pos + vec2(1.5, 1.5) * radius1 * vec2(px, py)).rgb; - bloom_sum1 += texture(tex, pos + vec2(-1.5, 1.5) * radius1 * vec2(px, py)).rgb; - bloom_sum1 += texture(tex, pos + vec2(0.0, -2.5) * radius1 * vec2(px, py)).rgb; - bloom_sum1 += texture(tex, pos + vec2(0.0, 2.5) * radius1 * vec2(px, py)).rgb; - bloom_sum1 += texture(tex, pos + vec2(-2.5, 0.0) * radius1 * vec2(px, py)).rgb; - bloom_sum1 += texture(tex, pos + vec2(2.5, 0.0) * radius1 * vec2(px, py)).rgb; - - bloom_sum1 *= 0.005; - - vec3 bloom_sum2 = texture(tex, pos + vec2(1.5, -1.5) * radius2 * vec2(px, py)).rgb; - bloom_sum2 += texture(tex, pos + vec2(-1.5, -1.5) * radius2 * vec2(px, py)).rgb; - bloom_sum2 += texture(tex, pos + vec2(1.5, 1.5) * radius2 * vec2(px, py)).rgb; - bloom_sum2 += texture(tex, pos + vec2(-1.5, 1.5) * radius2 * vec2(px, py)).rgb; - bloom_sum2 += texture(tex, pos + vec2(0.0, -2.5) * radius2 * vec2(px, py)).rgb; - bloom_sum2 += texture(tex, pos + vec2(0.0, 2.5) * radius2 * vec2(px, py)).rgb; - bloom_sum2 += texture(tex, pos + vec2(-2.5, 0.0) * radius2 * vec2(px, py)).rgb; - bloom_sum2 += texture(tex, pos + vec2(2.5, 0.0) * radius2 * vec2(px, py)).rgb; - - bloom_sum2 *= 0.010; - - float dist = radius2 - radius1; - vec3 HDR = (color + (bloom_sum2 - bloom_sum1)) * dist; - - vec3 blend = HDR + color; - color = pow(abs(blend), vec3(abs(HDRPower))) + HDR; - - return color; -} - -void main() -{ -vec4 R0f = vec4(0.0); -vec4 R1f = vec4(0.0); -vec4 R2f = vec4(0.0); -vec4 R123f = vec4(0.0); -vec4 R125f = vec4(0.0); -vec4 R126f = vec4(0.0); -vec4 R127f = vec4(0.0); -float backupReg0f, backupReg1f, backupReg2f, backupReg3f, backupReg4f; -vec4 PV0f = vec4(0.0), PV1f = vec4(0.0); -float PS0f = 0.0, PS1f = 0.0; -vec4 tempf = vec4(0.0); -float tempResultf; -int tempResulti; -ivec4 ARi = ivec4(0); -bool predResult = true; -vec3 cubeMapSTM; -int cubeMapFaceId; -R0f = passParameterSem0; -R1f = passParameterSem1; -R2f.xyzw = (texture(textureUnitPS2, R1f.xy).xyzw); -R1f.xyz = (texture(textureUnitPS0, R1f.xy).xyz); -// 0 -R127f.x = mul_nonIEEE(R0f.w, R2f.x); -PV0f.x = R127f.x; -R127f.y = mul_nonIEEE(R0f.w, R2f.y); -PV0f.y = R127f.y; -R127f.z = mul_nonIEEE(R0f.w, R2f.z); -PV0f.z = R127f.z; -R0f.w = R2f.w; -// 1 -tempf.x = dot(vec4(PV0f.x,PV0f.y,PV0f.z,-0.0),vec4(intBitsToFloat(0x3e99096c),intBitsToFloat(0x3f162b6b),intBitsToFloat(0x3dea4a8c),0.0)); -tempf.x = clamp(tempf.x, 0.0, 1.0); -PV1f.x = tempf.x; -PV1f.y = tempf.x; -PV1f.z = tempf.x; -PV1f.w = tempf.x; -// 2 -PV0f.x = -(PV1f.x) + 1.0; -// 3 -backupReg0f = R127f.y; -R127f.y = (mul_nonIEEE(R1f.z,PV0f.x) + R127f.z); -PV1f.y = R127f.y; -R126f.z = (mul_nonIEEE(R1f.y,PV0f.x) + backupReg0f); -PV1f.z = R126f.z; -R127f.w = (mul_nonIEEE(R1f.x,PV0f.x) + R127f.x); -PV1f.w = R127f.w; -// 4 -PV0f.x = PV1f.w * intBitsToFloat(0x40c66666); -R127f.z = PV1f.y * intBitsToFloat(0x40c66666); -PV0f.z = R127f.z; -PV0f.w = PV1f.z * intBitsToFloat(0x40c66666); -// 5 -PV1f.x = PV0f.w + intBitsToFloat(0x3fd9999a); -PV1f.y = PV0f.x + intBitsToFloat(0x3fd9999a); -PV1f.z = PV0f.x + 0.5; -PV1f.w = PV0f.z + intBitsToFloat(0x3fd9999a); -R125f.z = PV0f.w + 0.5; -PS1f = R125f.z; -// 6 -R126f.x = (mul_nonIEEE(R127f.y,PV1f.w) + intBitsToFloat(0x3d75c28f)); -R126f.y = (mul_nonIEEE(R126f.z,PV1f.x) + intBitsToFloat(0x3d75c28f)); -R123f.z = (mul_nonIEEE(R127f.w,PV1f.y) + intBitsToFloat(0x3d75c28f)); -PV0f.z = R123f.z; -PV0f.w = R127f.z + 0.5; -R127f.x = mul_nonIEEE(R127f.w, PV1f.z); -PS0f = R127f.x; -// 7 -backupReg0f = R125f.z; -R125f.z = mul_nonIEEE(R127f.y, PV0f.w); -R127f.w = mul_nonIEEE(R126f.z, backupReg0f); -PS1f = 1.0 / PV0f.z; -// 8 -R126f.z = R127f.x * PS1f; -PS0f = 1.0 / R126f.y; -// 9 -R126f.y = R127f.w * PS0f; -PS1f = 1.0 / R126f.x; -// 10 -R126f.x = R125f.z * PS1f; -tempResultf = log2(R126f.z); -if( isinf(tempResultf) == true ) tempResultf = -3.40282347E+38F; -PS0f = tempResultf; -// 11 -R126f.z = PS0f * intBitsToFloat(0x400ccccd); -tempResultf = log2(R126f.y); -if( isinf(tempResultf) == true ) tempResultf = -3.40282347E+38F; -PS1f = tempResultf; -// 12 -R127f.w = PS1f * intBitsToFloat(0x400ccccd); -tempResultf = log2(R126f.x); -if( isinf(tempResultf) == true ) tempResultf = -3.40282347E+38F; -PS0f = tempResultf; -// 13 -R126f.x = PS0f * intBitsToFloat(0x400ccccd); -PS1f = exp2(R126f.z); -// 14 -R1f.x = (mul_nonIEEE(PS1f,intBitsToFloat(uf_remappedPS[0].x)) + intBitsToFloat(uf_remappedPS[0].y)); -PS0f = exp2(R127f.w); -// 15 -R1f.y = (mul_nonIEEE(PS0f,intBitsToFloat(uf_remappedPS[0].x)) + intBitsToFloat(uf_remappedPS[0].y)); -PS1f = exp2(R126f.x); -// 16 -R1f.z = (mul_nonIEEE(PS1f,intBitsToFloat(uf_remappedPS[0].x)) + intBitsToFloat(uf_remappedPS[0].y)); -R0f.xyz = (texture(textureUnitPS1, vec3(R1f.x,R1f.y,R1f.z)).xyz); -// export -passPixelColor0 = vec4(R0f.x, R0f.y, R0f.z, R0f.w); - -// export -vec3 bloom = texture(textureUnitPS0, passParameterSem1.xy).xyz; -#if (adjust_bloom == 1) -bloom *= bloomFactor; -#endif -#if (HDRpassing == 1) -passPixelColor0.xyz = HDRPass(textureUnitPS2, passParameterSem1.xy).xyz; -#endif -#if (HDRpassing == 0) -passPixelColor0.xyz = texture(textureUnitPS2, passParameterSem1.xy).xyz; -#endif -#if (lumapassing == 1) - float smask = lumasharping(textureUnitPS2, passParameterSem1.xy); - passPixelColor0.xyz += vec3(smask); -#endif - vec3 color = (passPixelColor0.xyz); - color += bloom; -#if (Tone_map == 1) - color = ReshadeToneMap(color); -#endif -#if (Tone_map == 2) - color = linearToneMapping(color); -#endif -#if (Tone_map == 3) - color = simpleReinhardToneMapping(color); -#endif -#if (Tone_map == 4) - color = lumaBasedReinhardToneMapping(color); -#endif -#if (Tone_map == 5) - color = whitePreservingLumaBasedReinhardToneMapping(color); -#endif -#if (Tone_map == 6) - color = RomBinDaHouseToneMapping(color); -#endif -#if (Tone_map == 7) - color = filmicToneMapping(color); -#endif -#if (Tone_map == 8) - color = Uncharted2ToneMapping(color); -#endif -#if (tone_mapping == 9) - color = ACESFilm(color); -#endif -#if (blacknwhitepass == 1) - color = LevelsPass(color); -#endif -#if (Techine == 1) - color = Technicolor2(color); -#endif -#if (Tech == 1) - color = TechnicolorPass(color); -#endif -#if (Filmicpass == 1) - color = FilmPass(color); -#endif -#if (CurvesPss == 1) - color = CurvesPass(color); -#endif -#if (lggpass == 1) - color = LiftGammaGainPass(color); -#endif -#if (vibpass == 1) - color = VibrancePass(color); -#endif -passPixelColor0 = vec4(color, R0f.w); - -//passPixelColor0 = vec4(R0f.x, R0f.y, R0f.z, R0f.w); -} diff --git a/Enhancement/Splatoon_FX/4a377a50eda82af8_0000000000001e51_ps.txt b/Enhancement/Splatoon_FX/4a377a50eda82af8_0000000000001e51_ps.txt index b41189de..3cfb4d57 100644 --- a/Enhancement/Splatoon_FX/4a377a50eda82af8_0000000000001e51_ps.txt +++ b/Enhancement/Splatoon_FX/4a377a50eda82af8_0000000000001e51_ps.txt @@ -1,124 +1,746 @@ #version 420 #extension GL_ARB_texture_gather : enable -#extension GL_ARB_separate_shader_objects : enable // shader 4a377a50eda82af8 -// SplatFx -#define adjust_bloom 0 // 0: disable, 1: enable. -// BloomFactor -const float bloomFactor = 1.0; // Default is 1.0 -#define HDRpassing 0 // 0: disable, 1: enable. -// Fake High Dynamic Range. -const float HDRPower = 1.30; // 0.0 to 8.0 Default 1.30. -const float radius1 = 0.793; // 0.0 to 8.0 Default 0.793 -const float radius2 = 0.87; // 0.0 to 8.0 Default 0.87 "Raising this seems to make the effect stronger and also brighter." +//########################################################## +#define Preset 3 + // User Defined 0 + // Bruz Option 1 + // BSOD Option 2 + // Clarity Option 3 + // Contrasty Option 4 + // Serfrost Option 5 + // Sharpen Only Option 6 + // The Complaining Gamer Option 7 + // Filmic Preset Option 8 + // CellHunter Option 9 +//########################################################## +#if (Preset == 0) +// User Defined +//########################################################## +#define adjust_bloom 1 // 0: disable, 1: enable. +//BloomFactor +const float bloomFactor = 0.020; // Default is 0.020 (rough estimate based on Switch) -#define lumapassing 1 // 0: disable, 1: enable. -// LumaShapening -const float sharp_strength = 0.65; //[0.10 to 3.00] Strength of the sharpening Default is 0.65 -const float sharp_clamp = 0.085; //[0.000 to 1.000] Limits maximum amount of sharpening a pixel recieves - Default is 0.035 +#define HDRpassing 0 // 0: disable, 1: enable. +//Fake High Dynamic Range. +const float HDRPower = 1.00; // 0.0 to 8.0 Default 1.30. +const float radius1 = 1.00; // 0.0 to 8.0 Default 0.793 +const float radius2 = 0.80; // 0.0 to 8.0 Default 0.87 "Raising this seems to make the effect stronger and also brighter." - //Advanced sharpening settings +#define lumapassing 0 // 0: disable, 1: enable. +//LumaShapening +const float sharp_strength = 0.35; //[0.10 to 3.00] Strength of the sharpening Default is 0.65 +const float sharp_clamp = 0.85; //[0.000 to 1.000] Limits maximum amount of sharpening a pixel recieves - Default is 0.035 + +//Advanced sharpening settings const float offset_bias = 1.0; //[0.0 to 6.0] Offset bias adjusts the radius of the sampling pattern. -#define Tone_map 0 // 0: disable, 1-8: enable. +#define Tone_map 0 // 0: disable, -1 to 9: enable. + // -1: disable, loss of bright detail/color but keep [0,1] intact + // 0: (Wii U) BotW original // Reshade ToneMap Option 1 - // linearToneMapping Option 2 - // simpleReinhardToneMapping Option 3 - // lumaBasedReinhardToneMapping Option 4 - // whitePreservingLumaBasedReinhardToneMapping Option 5 - // RomBinDaHouseToneMapping Option 6 - // filmicToneMapping Option 7 + // linearToneMapping Option 2 + // simpleReinhardToneMapping Option 3 + // lumaBasedReinhardToneMapping Option 4 + // whitePreservingLumaBasedReinhardToneMapping Option 5 + // RomBinDaHouseToneMapping Option 6 + // filmicToneMapping Option 7 // Uncharted2ToneMapping Option 8 // ACES Filmic Option 9 - // Reshade ToneMap Controls -const float Exposure = 0.6; // [0.0, 1.0+] Adjust exposure -const float Bleach = 0.00; // "More bleach means more contrasted and less colorful image" min -0.5 max 1.0 Default 0.0 -const float defog = 0.004; // Default is 0.0 //How much of the overall color you want removed form the values of FogColor. -vec3 FogColor = vec3(1.0, 1.5, 1.7); // Color you want to Add or Remove 0.25 would add .25 percent of that color 1.25 would remove .25 percent of the color." -const float sat = 0.050; // "Adjust saturation" min -1.0 max 1.0 Default 0.0 + // Reshade ToneMap Controls / "Contrasty" Parameters +const float Exposure = 1.17; // [0.0, 1.0+] Adjust exposure +const float Bleach = 0.4; // "More bleach means more contrasted and less colorful image" min -0.5 max 1.0 Default 0.0 +const float Gamma = 1.00; // "Adjust midtones. 1.000 is neutral. This setting does exactly the same as the one in Lift Gamma Gain, only with less control." +const float defog = 0.00; // Default is 0.0 //How much of the overall color you want removed form the values of FogColor. +vec3 FogColor = vec3(1.0, 1.0, 1.0); // Color you want to Add or Remove 0.25 would add .25 percent of that color 1.25 would remove .25 percent of the color." +const float sat = 0.000; // "Adjust saturation" min -1.0 max 1.0 Default 0.0 +const float crushContrast = 0.000; // 0.0 is neutral. Use small increments, loss of shadow detail -#define blacknwhitepass 0 // 0: disable, 1: enable. -// Levels Control -const int BlackPoint = 16; // [0, 255] The black point is the new black - literally. Everything darker than this will become completely black +#define post_process 0 +//----------------"BotW original" vibrance adjust-------------// +const float satFactor = 0.25; // 0.18 is neutral. Experimental, adjust native saturation +//---------------------------------------------------------------// + +#define blacknwhitepass 0 // 0: disable, 1: enable. +// Levels Control +const int BlackPoint = 16; // [0, 255] The black point is the new black - literally. Everything darker than this will become completely black const int WhitePoint = 235; // [0, 255] The new white point. Everything brighter than this becomes completely white -#define lggpass 0 // 0: disable, 1: enable. -// Lift Gamma Gain -vec3 RGB_Lift = vec3( 1.000, 1.000, 1.000); // [0.000 to 2.000] Adjust shadows for Red, Green and Blue. -vec3 RGB_Gamma = vec3( 1.000, 1.00, 1.000); // [0.000 to 2.000] Adjust midtones for Red, Green and Blue -vec3 RGB_Gain = vec3( 1.000, 1.000, 1.000); // [0.000 to 2.000] Adjust highlights for Red, Green and Blue -// Note that a value of 1.0 is a neutral setting that leave the color unchanged. +#define lggpass 0 // 0: disable, 1: enable. +//Lift Gamma Gain +vec3 RGB_Lift = vec3(1.000, 1.000, 1.000); // [0.000 to 2.000] Adjust shadows for Red, Green and Blue. +vec3 RGB_Gamma = vec3(1.000, 1.000, 1.000); // [0.000 to 2.000] Adjust midtones for Red, Green and Blue +vec3 RGB_Gain = vec3(1.000, 1.000, 1.000); // [0.000 to 2.000] Adjust highlights for Red, Green and Blue + // Note that a value of 1.0 is a neutral setting that leave the color unchanged. -#define vibpass 0 // 0: disable, 1: enable. -// VibrancePass -uniform float Vibrance = 1.000; // "Intelligently saturates (or desaturates if you use negative values) the pixels depending on their original saturation."; -vec3 VibranceRGBBalance = vec3(1.00, 1.0, 1.0); // "A per channel multiplier to the Vibrance strength so you can give more boost to certain colors over others."; +#define vibpass 0 // 0: disable, 1: enable. +//VibrancePass +const float Vibrance = 0.150; // Default [0.150] "Intelligently saturates (or desaturates if you use negative values) the pixels depending on their original saturation." +vec3 VibranceRGBBalance = vec3(1.0, 1.0, 1.0); // "A per channel multiplier to the Vibrance strength so you can give more boost to certain colors over others."; -#define Tech 0 -// Technicolor -const float Power = 4.0; // Min 0.0 Max 8.0 Default 4.0 +#define Tech 0 // 0: disable, 1: enable. +//Technicolor +const float Power = 4.0; // Min 0.0 Max 8.0 Default 4.0 vec3 RGBNegativeAmount = vec3(0.88, 0.88, 0.88); -// To Edit Strength scroll down to Techicolor and edit it there, to not conflict with Filmic +float Strength = 0.20; // Min 0.0 Max 1.0 Default 0.4 -#define Techine 0 // 0: disable, 1: enable. -// Technicolor2 -const float Technicolor2_Red_Strength = 0.0; // "Higher means darker and more intense colors." Default 0.2 -const float Technicolor2_Green_Strength = 0.0; // "Higher means darker and more intense colors." Default 0.2 -const float Technicolor2_Blue_Strength = 0.0; // "Higher means darker and more intense colors." Default 0.2 -const float Technicolor2_Brightness = 0.0; // "Higher means brighter image." min 0.5 max 1.5 Default 1.0 -const float Technicolor2_Strength = 0.0; // Default is 1.0 -const float Technicolor2_Saturation = 1.00; // Default is 1.0 +#define Techine 0 // 0: disable, 1: enable. +//Technicolor2 +const float Technicolor2_Red_Strength = 0.02; // "Higher means darker and more intense colors." Default 0.2 +const float Technicolor2_Green_Strength = 0.02; // "Higher means darker and more intense colors." Default 0.2 +const float Technicolor2_Blue_Strength = 0.02; // "Higher means darker and more intense colors." Default 0.2 +const float Technicolor2_Brightness = 1.00; // "Higher means brighter image." min 0.5 max 1.5 Default 1.0 +const float Technicolor2_Strength = 1.00; // [Default is 1.0] +const float Technicolor2_Saturation = 1.00; // Default is 1.0 min 0.0 max 1.5 "Additional saturation control since this effect tends to oversaturate the image." -// Curves / Filmic Pass Contrast -#define CurvesPss 0 // 0: disable, 1: enable. -const float Contrast = 0.750; -// 1 To use curves Contrast, 0 off or to use with Filmic Pass. +#define cmatrix 0 +//Color Matrix +vec3 ColorMatrix_Red = vec3(0.817, 0.183, 0.000); +vec3 ColorMatrix_Green = vec3(0.333, 0.667, 0.000); +vec3 ColorMatrix_Blue = vec3(0.000, 0.125, 0.875); +float CM_Strength = 1.0; -#define Filmicpass 0 // 0: disable, 1: enable. -// Filmic Pass -const float Strength = 0.85; // "Strength of the color curve altering"; min 0.0 max 1.5 Default 0.85 -const float Fade = 0.5; // "Decreases contrast to imitate faded image" min 0.0 max 0.6 Default 0.4 -const float Linearization = 0.75; // min 0.5 max 2.0 Default 0.5 -const float Saturation = -0.15; // min -1.0 max 1.0 Default -0.15 +//Curves Contrast +#define CurvesPss 0 // 0: disable, 1: enable. +const float Contrast = 0.65; // Default 0.65 min -1.0 max = 1.0 "The amount of contrast you want." -const float RedCurve = 1.0; // min 0.0 max 2.0 Default 1.0 -const float GreenCurve = 1.0; // min 0.0 max 2.0 Default 1.0 -const float BlueCurve = 1.0; // min 0.0 max 2.0 Default 1.0 -const float BaseCurve = 1.5; // min 0.0 max 2.0 Default 1.5 +#define Filmicpass 0 // 0: disable, 1: enable. +//Filmic Pass +const float Filmic_Contrast = 1.0; // Default 1.0 min 0.5 max 2.0 +const float Filmic_Bleach = 0.0; // "More bleach means more contrasted and less colorful image" min -0.5 max 1.0 Default 0.0 +const float Saturation = -0.15; // min -1.0 max 1.0 Default -0.15 -const float BaseGamma = 1.0; // min 0.7 max 2.0 Default 1.0 -const float EffectGamma = 0.68; // min 0.0 max 2.0 Default 0.68 -const float EffectGammaR = 1.0; // min 0.0 max 2.0 Default 1.0 -const float EffectGammaG = 1.0; // min 0.0 max 2.0 Default 1.0 -const float EffectGammaB = 1.0; // min 0.0 max 2.0 Default 1.0 +const float Filmic_Strength = 0.85; // "Strength of the color curve altering"; min 0.0 max 1.5 Default 0.85 +const float Fade = 0.4; // "Decreases contrast to imitate faded image" min 0.0 max 0.6 Default 0.4 +const float Linearization = 0.5; // min 0.5 max 2.0 Default 0.5 +const float BaseCurve = 1.5; // min 0.0 max 2.0 Default 1.5 +const float BaseGamma = 1.00; // min 0.7 max 2.0 Default 1.0 +const float EffectGamma = 0.68; // min 0.0 max 2.0 Default 0.68 + +#define dpxpass 0 +//DPX +vec3 RGB_Curve = vec3(8.0, 8.0, 8.0); +vec3 RGB_C = vec3(0.36, 0.36, 0.34); + +float DPX_Contrast = 0.1; +float DPX_Saturation = 3.0; +float Colorfulness = 2.5; + +float DPX_Strength = 0.20; +//########################################################### +//Do not edit under this line. +//Presets +#elif (Preset == 1) + #define adjust_bloom 1 + const float bloomFactor = 0.30; + #define HDRpassing 0 + float HDRPower = 1.00; + float radius1 = 1.00; + float radius2 = 0.80; + #define lumapassing 0 + float sharp_strength = 0.45; + float sharp_clamp = 0.085; + float offset_bias = 1.0; + #define Tone_map 8 + const float Exposure = 1.17; + const float Bleach = 0.4; + const float Gamma = 1.00; + const float defog = 0.00; + vec3 FogColor = vec3(1.0, 1.0, 1.0); + const float sat = 0.000; + const float crushContrast = 0.000; + #define post_process 1 + const float satFactor = 0.25; + #define blacknwhitepass 1 + const int BlackPoint = 1; + const int WhitePoint = 220; + #define lggpass 1 + vec3 RGB_Lift = vec3(1.000, 1.000, 1.000); + vec3 RGB_Gamma = vec3(1.000, 1.000, 1.000); + vec3 RGB_Gain = vec3(1.000, 1.000, 1.000); + #define vibpass 0 + const float Vibrance = 0.150; + vec3 VibranceRGBBalance = vec3(1.0, 1.0, 1.0); + #define Tech 1 + const float Power = 8.0; + vec3 RGBNegativeAmount = vec3(0.88, 0.88, 0.88); + float Strength = 0.3; + #define Techine 1 + float Technicolor2_Red_Strength = -0.05; + float Technicolor2_Green_Strength = -0.1; + float Technicolor2_Blue_Strength = 0.07; + float Technicolor2_Brightness = 0.0; + float Technicolor2_Strength = 2.0; + float Technicolor2_Saturation = 1.3; //1.13 to completely fix lava + #define cmatrix 0 + vec3 ColorMatrix_Red = vec3(0.817, 0.183, 0.000); + vec3 ColorMatrix_Green = vec3(0.333, 0.667, 0.000); + vec3 ColorMatrix_Blue = vec3(0.000, 0.125, 0.875); + float CM_Strength = 1.0; + #define CurvesPss 0 + const float Contrast = 0.65; + #define Filmicpass 1 + const float Filmic_Strength = 0.60; + const float Filmic_Contrast = 1.03; + const float Fade = 0.0; + const float Linearization = 1.0; + const float Filmic_Bleach = 0.0; + const float Saturation = -0.3; + const float BaseCurve = 1.5; + const float BaseGamma = 1.0; + const float EffectGamma = 0.68; + #define dpxpass 0 + vec3 RGB_Curve = vec3(8.0, 8.0, 8.0); + vec3 RGB_C = vec3(0.36, 0.36, 0.34); + float DPX_Contrast = 0.1; + float DPX_Saturation = 3.0; + float Colorfulness = 2.5; + float DPX_Strength = 0.20; +#elif (Preset == 2) + #define adjust_bloom 1 + const float bloomFactor = 0.010; + #define HDRpassing 1 + const float HDRPower = 1.085; + const float radius1 = 0.793; + const float radius2 = 0.87; + #define lumapassing 1 + const float sharp_strength = 0.25; + const float sharp_clamp = 0.085; + const float offset_bias = 1.0; + #define Tone_map 8 + const float Exposure = 0.6; + const float Bleach = 0.3; + const float Gamma = 1.00; + const float defog = 0.004; + vec3 FogColor = vec3(1.0, 1.5, 1.7); + const float sat = 0.050; + const float crushContrast = 0.000; + #define post_process 0 + const float satFactor = 0.25; + #define blacknwhitepass 0 + const int BlackPoint = 8; + const int WhitePoint = 235; + #define lggpass 1 + vec3 RGB_Lift = vec3(0.994, 0.994, 0.994); + vec3 RGB_Gamma = vec3(1.0, 0.990, 1.0); + vec3 RGB_Gain = vec3(1.0, 0.990, 1.00); + #define vibpass 1 + const float Vibrance = 0.113; + vec3 VibranceRGBBalance = vec3(1.0, 1.0, 1.0); + #define Tech 0 + const float Power = 4.0; + vec3 RGBNegativeAmount = vec3(0.88, 0.88, 0.88); + float Strength = 0.20; + #define Techine 0 + const float Technicolor2_Red_Strength = 0.000; + const float Technicolor2_Green_Strength = 0.000; + const float Technicolor2_Blue_Strength = 0.000; + const float Technicolor2_Brightness = 1.0; + const float Technicolor2_Strength = 0.40; + const float Technicolor2_Saturation = 0.70; + #define cmatrix 0 + vec3 ColorMatrix_Red = vec3(0.817, 0.183, 0.000); + vec3 ColorMatrix_Green = vec3(0.333, 0.667, 0.000); + vec3 ColorMatrix_Blue = vec3(0.000, 0.125, 0.875); + float CM_Strength = 1.0; + #define CurvesPss 0 + const float Contrast = 0.65; + #define Filmicpass 1 + const float Filmic_Contrast = 1.0; + const float Filmic_Bleach = 0.0; + const float Saturation = -0.15; + const float Filmic_Strength = 0.85; + const float Fade = 0.4; + const float Linearization = 0.5; + const float BaseCurve = 1.5; + const float BaseGamma = 0.7; + const float EffectGamma = 0.68; + #define dpxpass 0 + vec3 RGB_Curve = vec3(8.0, 8.0, 8.0); + vec3 RGB_C = vec3(0.36, 0.36, 0.34); + float DPX_Contrast = 0.1; + float DPX_Saturation = 3.0; + float Colorfulness = 2.5; + float DPX_Strength = 0.20; +#elif (Preset == 3) + #define adjust_bloom 1 + const float bloomFactor = 0.020; + #define HDRpassing 1 + const float HDRPower = 1.00; + const float radius1 = 1.00; + const float radius2 = 0.80; + #define lumapassing 1 + const float sharp_strength = 0.35; + const float sharp_clamp = 0.85; + const float offset_bias = 1.0; + #define Tone_map 8 + const float Exposure = 1.17; + const float Bleach = 0.4; + const float Gamma = 1.00; + const float defog = 0.00; + vec3 FogColor = vec3(1.0, 1.0, 1.0); + const float sat = 0.000; + const float crushContrast = 0.000; + #define post_process 1 + const float satFactor = 0.25; + #define blacknwhitepass 0 + const int BlackPoint = 16; + const int WhitePoint = 235; + #define lggpass 1 + vec3 RGB_Lift = vec3(0.980, 0.980, 0.980); + vec3 RGB_Gamma = vec3(1.000, 1.000, 1.000); + vec3 RGB_Gain = vec3(1.000, 1.000, 1.000); + #define vibpass 0 + const float Vibrance = 0.150; + vec3 VibranceRGBBalance = vec3(1.0, 1.0, 1.0); + #define Tech 0 + const float Power = 4.0; + vec3 RGBNegativeAmount = vec3(0.88, 0.88, 0.88); + float Strength = 0.20; + #define Techine 0 + const float Technicolor2_Red_Strength = 0.02; + const float Technicolor2_Green_Strength = 0.02; + const float Technicolor2_Blue_Strength = 0.02; + const float Technicolor2_Brightness = 1.00; + const float Technicolor2_Strength = 1.00; + const float Technicolor2_Saturation = 1.00; + #define cmatrix 0 + vec3 ColorMatrix_Red = vec3(0.817, 0.183, 0.000); + vec3 ColorMatrix_Green = vec3(0.333, 0.667, 0.000); + vec3 ColorMatrix_Blue = vec3(0.000, 0.125, 0.875); + float CM_Strength = 1.0; + #define CurvesPss 0 + const float Contrast = 0.65; + #define Filmicpass 0 + const float Filmic_Contrast = 1.0; + const float Filmic_Bleach = 0.0; + const float Saturation = -0.15; + const float Filmic_Strength = 0.85; + const float Fade = 0.4; + const float Linearization = 0.5; + const float BaseCurve = 1.5; + const float BaseGamma = 1.00; + const float EffectGamma = 0.68; + #define dpxpass 1 + vec3 RGB_Curve = vec3(8.0, 8.0, 8.0); + vec3 RGB_C = vec3(0.36, 0.36, 0.34); + float DPX_Contrast = 0.1; + float DPX_Saturation = 0.0; + float Colorfulness = 1.0; + float DPX_Strength = 0.20; +#elif (Preset == 4) + #define adjust_bloom 1 + const float bloomFactor = 0.020; + #define HDRpassing 0 + const float HDRPower = 1.00; + const float radius1 = 1.00; + const float radius2 = 0.80; + #define lumapassing 0 + const float sharp_strength = 0.35; + const float sharp_clamp = 0.85; + const float offset_bias = 1.0; + #define Tone_map 1 + const float Exposure = 1.17; + const float Bleach = 0.3; + const float Gamma = 0.810; + const float defog = 0.00; + vec3 FogColor = vec3(1.0, 1.0, 1.0); + const float sat = 0.000; + const float crushContrast = 0.000; + #define post_process 1 + const float satFactor = 0.25; + #define blacknwhitepass 0 + const int BlackPoint = 16; + const int WhitePoint = 235; + #define lggpass 0 + vec3 RGB_Lift = vec3(1.000, 1.000, 1.000); + vec3 RGB_Gamma = vec3(1.000, 1.000, 1.000); + vec3 RGB_Gain = vec3(1.000, 1.000, 1.000); + #define vibpass 0 + const float Vibrance = 0.150; + vec3 VibranceRGBBalance = vec3(1.0, 1.0, 1.0); + #define Tech 0 + const float Power = 4.0; + vec3 RGBNegativeAmount = vec3(0.88, 0.88, 0.88); + float Strength = 0.20; + #define Techine 0 + const float Technicolor2_Red_Strength = 0.02; + const float Technicolor2_Green_Strength = 0.02; + const float Technicolor2_Blue_Strength = 0.02; + const float Technicolor2_Brightness = 1.00; + const float Technicolor2_Strength = 1.00; + const float Technicolor2_Saturation = 1.00; + #define cmatrix 0 + vec3 ColorMatrix_Red = vec3(0.817, 0.183, 0.000); + vec3 ColorMatrix_Green = vec3(0.333, 0.667, 0.000); + vec3 ColorMatrix_Blue = vec3(0.000, 0.125, 0.875); + float CM_Strength = 1.0; + #define CurvesPss 1 + const float Contrast = 0.65; + #define Filmicpass 0 + const float Filmic_Contrast = 1.0; + const float Filmic_Bleach = 0.0; + const float Saturation = -0.15; + const float Filmic_Strength = 0.85; + const float Fade = 0.4; + const float Linearization = 0.5; + const float BaseCurve = 1.5; + const float BaseGamma = 1.00; + const float EffectGamma = 0.68; + #define dpxpass 0 + vec3 RGB_Curve = vec3(8.0, 8.0, 8.0); + vec3 RGB_C = vec3(0.36, 0.36, 0.34); + float DPX_Contrast = 0.1; + float DPX_Saturation = 3.0; + float Colorfulness = 2.5; + float DPX_Strength = 0.20; +#elif (Preset == 5) + #define adjust_bloom 1 + const float bloomFactor = 0.40; + #define HDRpassing 1 + const float HDRPower = 1.20; + const float radius1 = 0.793; + const float radius2 = 0.87; + #define lumapassing 0 + const float sharp_strength = 0.45; + const float sharp_clamp = 0.85; + const float offset_bias = 1.0; + #define Tone_map 8 + const float Exposure = 1.17; + const float Bleach = 0.0; + const float Gamma = 0.98; + const float defog = 1.00; + vec3 FogColor = vec3(1.0, 1.0, 1.0); + const float sat = 0.00; + const float crushContrast = 0.00; + #define post_process 0 + const float satFactor = 0.07; + #define blacknwhitepass 1 + const int BlackPoint = 2; + const int WhitePoint = 300; + #define lggpass 1 + vec3 RGB_Lift = vec3(1.027, 1.027, 1.027); + vec3 RGB_Gamma = vec3(0.83, 0.83, 0.83); + vec3 RGB_Gain = vec3(1.10, 1.10, 1.10); + #define vibpass 1 + const float Vibrance = 0.15; + vec3 VibranceRGBBalance = vec3(1.0, 1.0, 1.0); + #define Tech 0 + const float Power = 5.0; + vec3 RGBNegativeAmount = vec3(0.88, 0.88, 0.88); + float Strength = 0.10; + #define Techine 1 + float Technicolor2_Red_Strength = -0.09; + float Technicolor2_Green_Strength = -0.09; + float Technicolor2_Blue_Strength = -0.00; + float Technicolor2_Brightness = 0.4; + float Technicolor2_Strength = 1.2; + float Technicolor2_Saturation = 1.1; + #define cmatrix 0 + vec3 ColorMatrix_Red = vec3(0.817, 0.183, 0.000); + vec3 ColorMatrix_Green = vec3(0.333, 0.667, 0.000); + vec3 ColorMatrix_Blue = vec3(0.000, 0.125, 0.875); + float CM_Strength = 1.0; + #define CurvesPss 0 + const float Contrast = 0.0; + #define Filmicpass 1 + const float Filmic_Contrast = 1.0; + const float Filmic_Bleach = 0.0; + const float Saturation = -0.17; + const float Filmic_Strength = 0.48; + const float Fade = 0.08; + const float Linearization = 1.0; + const float BaseCurve = 1.0; + const float BaseGamma = 1.0; + const float EffectGamma = 1.68; + #define dpxpass 0 + vec3 RGB_Curve = vec3(8.0, 8.0, 8.0); + vec3 RGB_C = vec3(0.36, 0.36, 0.34); + float DPX_Contrast = 0.1; + float DPX_Saturation = 3.0; + float Colorfulness = 1.0; + float DPX_Strength = 0.20; +#elif (Preset == 6) + #define adjust_bloom 0 + const float bloomFactor = 0.20; + #define HDRpassing 0 + const float HDRPower = 1.00; + const float radius1 = 1.00; + const float radius2 = 0.80; + #define lumapassing 1 + const float sharp_strength = 1.70; + const float sharp_clamp = 0.35; + const float offset_bias = 1.0; + #define Tone_map 0 + const float Exposure = 1.17; + const float Bleach = 0.4; + const float Gamma = 1.00; + const float defog = 0.00; + vec3 FogColor = vec3(1.0, 1.0, 1.0); + const float sat = 0.000; + const float crushContrast = 0.000; + #define post_process 0 + const float satFactor = 0.25; + #define blacknwhitepass 0 + const int BlackPoint = 16; + const int WhitePoint = 235; + #define lggpass 0 + vec3 RGB_Lift = vec3(1.000, 1.000, 1.000); + vec3 RGB_Gamma = vec3(1.000, 1.000, 1.000); + vec3 RGB_Gain = vec3(1.000, 1.000, 1.000); + #define vibpass 0 + const float Vibrance = 0.150; + vec3 VibranceRGBBalance = vec3(1.0, 1.0, 1.0); + #define Tech 0 + const float Power = 4.0; + vec3 RGBNegativeAmount = vec3(0.88, 0.88, 0.88); + float Strength = 0.20; + #define Techine 0 + const float Technicolor2_Red_Strength = 0.02; + const float Technicolor2_Green_Strength = 0.02; + const float Technicolor2_Blue_Strength = 0.02; + const float Technicolor2_Brightness = 1.00; + const float Technicolor2_Strength = 1.00; + const float Technicolor2_Saturation = 1.00; + #define cmatrix 0 + vec3 ColorMatrix_Red = vec3(0.817, 0.183, 0.000); + vec3 ColorMatrix_Green = vec3(0.333, 0.667, 0.000); + vec3 ColorMatrix_Blue = vec3(0.000, 0.125, 0.875); + float CM_Strength = 1.0; + #define CurvesPss 0 + const float Contrast = 0.65; + #define Filmicpass 0 + const float Filmic_Contrast = 1.0; + const float Filmic_Bleach = 0.0; + const float Saturation = -0.15; + const float Filmic_Strength = 0.85; + const float Fade = 0.4; + const float Linearization = 0.5; + const float BaseCurve = 1.5; + const float BaseGamma = 1.00; + const float EffectGamma = 0.68; + #define dpxpass 0 + vec3 RGB_Curve = vec3(8.0, 8.0, 8.0); + vec3 RGB_C = vec3(0.36, 0.36, 0.34); + float DPX_Contrast = 0.1; + float DPX_Saturation = 3.0; + float Colorfulness = 2.5; + float DPX_Strength = 0.20; +#elif (Preset == 7) + #define adjust_bloom 1 + const float bloomFactor = 0.33; + #define HDRpassing 1 + const float HDRPower = 1.020; + const float radius1 = 0.793; + const float radius2 = 0.87; + #define lumapassing 1 + const float sharp_strength = 0.25; + const float sharp_clamp = 0.85; + const float offset_bias = 1.0; + #define Tone_map 8 + const float Exposure = 1.17; + const float Bleach = 0.4; + const float Gamma = 1.00; + const float defog = 0.00; + vec3 FogColor = vec3(1.0, 1.0, 1.0); + const float sat = 0.000; + const float crushContrast = 0.000; + #define post_process 0 + const float satFactor = 0.25; + #define blacknwhitepass 0 + const int BlackPoint = 16; + const int WhitePoint = 235; + #define lggpass 1 + vec3 RGB_Lift = vec3(1.000, 1.000, 1.000); + vec3 RGB_Gamma = vec3(0.600, 0.600, 0.600); + vec3 RGB_Gain = vec3(1.000, 1.000, 1.000); + #define vibpass 1 + const float Vibrance = 0.150; + vec3 VibranceRGBBalance = vec3(1.0, 1.0, 1.0); + #define Tech 0 + const float Power = 4.0; + vec3 RGBNegativeAmount = vec3(0.88, 0.88, 0.88); + float Strength = 0.20; + #define Techine 1 + const float Technicolor2_Red_Strength = 0.000; + const float Technicolor2_Green_Strength = 0.000; + const float Technicolor2_Blue_Strength = 0.000; + const float Technicolor2_Brightness = 1.0; + const float Technicolor2_Strength = 0.40; + const float Technicolor2_Saturation = 0.51; + #define cmatrix 0 + vec3 ColorMatrix_Red = vec3(0.817, 0.183, 0.000); + vec3 ColorMatrix_Green = vec3(0.333, 0.667, 0.000); + vec3 ColorMatrix_Blue = vec3(0.000, 0.125, 0.875); + float CM_Strength = 1.0; + #define CurvesPss 1 + const float Contrast = 0.65; + #define Filmicpass 0 + const float Filmic_Contrast = 1.0; + const float Filmic_Bleach = 0.0; + const float Saturation = -0.15; + const float Filmic_Strength = 0.85; + const float Fade = 0.4; + const float Linearization = 0.5; + const float BaseCurve = 1.5; + const float BaseGamma = 1.00; + const float EffectGamma = 0.68; + #define dpxpass 0 + vec3 RGB_Curve = vec3(8.0, 8.0, 8.0); + vec3 RGB_C = vec3(0.36, 0.36, 0.34); + float DPX_Contrast = 0.1; + float DPX_Saturation = 3.0; + float Colorfulness = 2.5; + float DPX_Strength = 0.20; +#elif (Preset == 8) + #define adjust_bloom 1 + const float bloomFactor = 0.020; + #define HDRpassing 1 + const float HDRPower = 1.20; + const float radius1 = 1.00; + const float radius2 = 0.80; + #define lumapassing 1 + const float sharp_strength = 0.35; + const float sharp_clamp = 0.85; + const float offset_bias = 1.0; + #define Tone_map 8 + const float Exposure = 1.17; + const float Bleach = 0.4; + const float Gamma = 1.00; + const float defog = 0.00; + vec3 FogColor = vec3(1.0, 1.0, 1.0); + const float sat = 0.000; + const float crushContrast = 0.000; + #define post_process 1 + const float satFactor = 0.25; + #define blacknwhitepass 0 + const int BlackPoint = 16; + const int WhitePoint = 235; + #define lggpass 0 + vec3 RGB_Lift = vec3(0.990, 0.990, 0.990); + vec3 RGB_Gamma = vec3(1.000, 1.000, 1.000); + vec3 RGB_Gain = vec3(1.000, 1.000, 1.000); + #define vibpass 1 + const float Vibrance = 0.150; + vec3 VibranceRGBBalance = vec3(1.0, 1.0, 1.0); + #define Tech 0 + const float Power = 4.0; + vec3 RGBNegativeAmount = vec3(0.88, 0.88, 0.88); + float Strength = 0.20; + #define Techine 0 + const float Technicolor2_Red_Strength = 0.02; + const float Technicolor2_Green_Strength = 0.02; + const float Technicolor2_Blue_Strength = 0.02; + const float Technicolor2_Brightness = 1.00; + const float Technicolor2_Strength = 1.00; + const float Technicolor2_Saturation = 1.00; + #define cmatrix 0 + vec3 ColorMatrix_Red = vec3(0.817, 0.183, 0.000); + vec3 ColorMatrix_Green = vec3(0.333, 0.667, 0.000); + vec3 ColorMatrix_Blue = vec3(0.000, 0.125, 0.875); + float CM_Strength = 1.0; + #define CurvesPss 1 + const float Contrast = 0.65; + #define Filmicpass 1 + const float Filmic_Contrast = 1.0; + const float Filmic_Bleach = 0.0; + const float Saturation = -0.15; + const float Filmic_Strength = 0.85; + const float Fade = 0.4; + const float Linearization = 0.5; + const float BaseCurve = 1.5; + const float BaseGamma = 1.00; + const float EffectGamma = 0.68; + #define dpxpass 1 + vec3 RGB_Curve = vec3(8.0, 8.0, 8.0); + vec3 RGB_C = vec3(0.36, 0.36, 0.34); + float DPX_Contrast = 0.1; + float DPX_Saturation = 2.0; + float Colorfulness = 1.5; + float DPX_Strength = 0.20; +#elif (Preset == 9) + #define adjust_bloom 1 + const float bloomFactor = 0.445; + #define HDRpassing 1 + const float HDRPower = 1.000; + const float radius1 = 1.135; + const float radius2 = 1.000; + #define lumapassing 1 + const float sharp_strength = 0.65; + const float sharp_clamp = 0.75; + const float offset_bias = 1.0; + #define Tone_map 8 + const float Exposure = 1.17; + const float Bleach = 0.0; + const float Gamma = 1.00; + const float defog = 0.00; + vec3 FogColor = vec3(1.0, 1.0, 1.0); + const float sat = 0.000; + const float crushContrast = 0.000; + #define post_process 0 + const float satFactor = 0.25; + #define blacknwhitepass 0 + const int BlackPoint = 16; + const int WhitePoint = 215; + #define lggpass 1 + vec3 RGB_Lift = vec3(0.985, 0.960, 1.005); + vec3 RGB_Gamma = vec3(0.985, 0.960, 1.005); + vec3 RGB_Gain = vec3(0.985, 0.960, 1.005); + #define vibpass 1 + const float Vibrance = 0.245; + vec3 VibranceRGBBalance = vec3(1.00, 1.00, 1.00); + #define Tech 0 + const float Power = 4.0; + vec3 RGBNegativeAmount = vec3(0.88, 0.88, 0.88); + float Strength = 0.20; + #define Techine 0 + const float Technicolor2_Red_Strength = 0.02; + const float Technicolor2_Green_Strength = 0.02; + const float Technicolor2_Blue_Strength = 0.02; + const float Technicolor2_Brightness = 1.00; + const float Technicolor2_Strength = 1.00; + const float Technicolor2_Saturation = 1.00; + #define cmatrix 0 + vec3 ColorMatrix_Red = vec3(0.817, 0.183, 0.000); + vec3 ColorMatrix_Green = vec3(0.333, 0.667, 0.000); + vec3 ColorMatrix_Blue = vec3(0.000, 0.125, 0.875); + float CM_Strength = 1.0; + #define CurvesPss 1 + const float Contrast = 0.245; + #define Filmicpass 0 + const float Filmic_Contrast = 0.97; + const float Filmic_Bleach = 0.0; + const float Saturation = -0.15; + const float Filmic_Strength = 0.65; + const float Fade = 0.2; + const float Linearization = 0.7; + const float BaseCurve = 1.5; + const float BaseGamma = 0.90; + const float EffectGamma = 0.68; + #define dpxpass 0 + vec3 RGB_Curve = vec3(8.0, 8.0, 8.0); + vec3 RGB_C = vec3(0.36, 0.36, 0.34); + float DPX_Contrast = 0.1; + float DPX_Saturation = 3.0; + float Colorfulness = 2.5; + float DPX_Strength = 0.20; +#endif //########################################################### -// Do not edit under this line. - uniform ivec4 uf_remappedPS[1]; -layout(binding = 0) uniform sampler2D textureUnitPS0;// Tex0 addr 0xf494a800 res 320x180x1 dim 1 tm: 4 format 0816 compSel: 0 1 2 5 mipView: 0x0 (num 0x5) sliceView: 0x0 (num 0x1) Sampler0 ClampX/Y/Z: 2 2 2 border: 1 -layout(binding = 1) uniform sampler3D textureUnitPS1;// Tex1 addr 0x1eb57800 res 8x8x8 dim 2 tm: 3 format 0816 compSel: 0 1 2 5 mipView: 0x0 (num 0x1) sliceView: 0x0 (num 0x8) Sampler1 ClampX/Y/Z: 2 2 2 border: 1 -layout(binding = 2) uniform sampler2D textureUnitPS2;// Tex2 addr 0xf45c6000 res 1280x720x1 dim 1 tm: 4 format 0816 compSel: 0 1 2 5 mipView: 0x0 (num 0x1) sliceView: 0x0 (num 0x1) Sampler2 ClampX/Y/Z: 2 2 2 border: 1 -layout(location = 0) in vec4 passParameterSem0; +layout(binding = 0) uniform sampler2D textureUnitPS0; // Bloom +layout(binding = 2) uniform sampler2D textureUnitPS2;// HDR LumaShapening. layout(location = 1) in vec4 passParameterSem1; layout(location = 0) out vec4 passPixelColor0; uniform vec2 uf_fragCoordScale; -int clampFI32(int v) -{ -if( v == 0x7FFFFFFF ) - return floatBitsToInt(1.0); -else if( v == 0xFFFFFFFF ) - return floatBitsToInt(0.0); -return floatBitsToInt(clamp(intBitsToFloat(v), 0.0, 1.0)); -} -float mul_nonIEEE(float a, float b){ if( a == 0.0 || b == 0.0 ) return 0.0; return a*b; } -// ToneMapping +//ToneMapping vec3 linearToneMapping(vec3 color) { float exposure = 1.; color = clamp(exposure * color, 0., 1.); + color = pow(color, vec3(1. / Gamma)); return color; } @@ -126,6 +748,7 @@ vec3 simpleReinhardToneMapping(vec3 color) { float exposure = 1.5; color *= exposure / (1. + color / exposure); + color = pow(color, vec3(1. / Gamma)); return color; } @@ -134,6 +757,7 @@ vec3 lumaBasedReinhardToneMapping(vec3 color) float luma = dot(color, vec3(0.2126, 0.7152, 0.0722)); float toneMappedLuma = luma / (1. + luma); color *= toneMappedLuma / luma; + color = pow(color, vec3(1. / Gamma)); return color; } @@ -143,12 +767,14 @@ vec3 whitePreservingLumaBasedReinhardToneMapping(vec3 color) float luma = dot(color, vec3(0.2126, 0.7152, 0.0722)); float toneMappedLuma = luma * (1. + luma / (white*white)) / (1. + luma); color *= toneMappedLuma / luma; + color = pow(color, vec3(1. / Gamma)); return color; } vec3 RomBinDaHouseToneMapping(vec3 color) { color = exp(-1.0 / (2.72*color + 0.15)); + color = pow(color, vec3(1. / Gamma)); return color; } @@ -173,12 +799,15 @@ vec3 Uncharted2ToneMapping(vec3 color) color = ((color * (A * color + C * B) + D * E) / (color * (A * color + B) + D * F)) - E / F; float white = ((W * (A * W + C * B) + D * E) / (W * (A * W + B) + D * F)) - E / F; color /= white; + color = pow(color, vec3(1. / Gamma)); return color; } vec3 ReshadeToneMap(vec3 inputColor) { vec3 color = inputColor; color = clamp(color - defog * FogColor * 2.55, 0.0, 1.0); // defog + color *= Exposure / (1.0 + color / Exposure); + color = pow(color, vec3(1. / Gamma)); // Gamma const vec3 coefLuma = vec3(0.2126, 0.7152, 0.0722); float lum = dot(coefLuma, color); @@ -200,9 +829,22 @@ vec3 ReshadeToneMap(vec3 inputColor) { return color; } + +float getL601(vec3 rgb) { + return dot(rgb, vec3(0.2989, 0.5866, 0.1145)); +} + float getL709(vec3 rgb) { return dot(rgb, vec3(0.2126, 0.7152, 0.0722)); } + +vec3 BotWToneMap(vec3 color) { + float Lumn = getL601(color); + vec4 exptm = 1.0 - exp(-vec4(color, Lumn)); + vec3 cpre = exptm.w / Lumn * color; + vec3 colorldr = mix(cpre, exptm.rgb, vec3(pow(exptm.w, 2.0)));//refine + return colorldr; +} vec3 ACESFilm(vec3 color) { color *= Exposure; float Lumn = getL709(color); @@ -213,7 +855,7 @@ vec3 ACESFilm(vec3 color) { return colorldr; } -// Curves +//Curves vec3 CurvesPass(vec3 inputColor) { vec3 colorInput = inputColor; @@ -225,7 +867,7 @@ vec3 CurvesPass(vec3 inputColor) { return colorInput; } -// TECHNICOLOR2 +//TECHNICOLOR2 vec3 Technicolor2(vec3 inputColor) { vec3 color = inputColor; @@ -254,10 +896,10 @@ vec3 Technicolor2(vec3 inputColor) { return color; } -// Technicolor +//Technicolor vec3 TechnicolorPass(vec3 color) { - float Strength = 0.20; // Min 0.0 Max 1.0 Default 0.4 + const vec3 cyanfilter = vec3(0.0, 1.30, 1.0); const vec3 magentafilter = vec3(1.0, 0.0, 1.05); const vec3 yellowfilter = vec3(1.6, 1.6, 0.05); @@ -277,7 +919,48 @@ vec3 TechnicolorPass(vec3 color) return mix(tcol, output_r * output_g * output_b, Strength); } -// Levels +//ColorMatrix +vec3 ColorMatrixPass(vec3 inputColor) +{ + vec3 color = inputColor; + + const mat3 ColorMatrix = mat3(ColorMatrix_Red, ColorMatrix_Green, ColorMatrix_Blue); + //color = mix(color, * (ColorMatrix, color), CM_Strength); + color *= mix(color, (ColorMatrix, color), CM_Strength); + return clamp(color, 0.0, 1.); +} + +// Contrasty + +vec3 BotWVibrance(vec3 color) { + float avg = (color.r + color.g + color.b) / 3.0; + //float maxc = max(color.r, max(color.g, color.b)); + float w = 1.0 - pow(1.0 - 2.0 * avg, 2.0); + float weight = 1.0 + w * satFactor; + //vec3 satcolor = mix(vec3(maxc), color, weight); + vec3 satcolor = mix(vec3(color), color, weight); + return satcolor; +} + +vec3 ReshadeVibrance(vec3 color) { + float max_color = max(color.r, max(color.g, color.b)); // Find the strongest color + float min_color = min(color.r, min(color.g, color.b)); // Find the weakest color + float luma = getL709(color); + float color_saturation = max_color - min_color; // The difference between the two is the saturation + vec3 coeffVibrance = VibranceRGBBalance * Vibrance; + color = mix(vec3(luma), color, 1.0 + (coeffVibrance * (1.0 - (sign(coeffVibrance) * color_saturation)))); + return color; +} + +vec3 Contrasty(vec3 fColour) { + fColour = max(vec3(0.0), fColour - vec3(crushContrast)); + fColour = clamp(Exposure * fColour, 0.0, 1.0); + fColour = pow(fColour, vec3(1.0 / Gamma)); + fColour = ReshadeVibrance(fColour); // reshade's identical, only a little stronger when at same setting + return fColour; +} + +// Levels vec3 LevelsPass(vec3 inputColor) { float black_point_float = BlackPoint / 255.0; @@ -289,7 +972,7 @@ vec3 LevelsPass(vec3 inputColor) { return color; } -// FilmPass +//FilmPass vec3 FilmPass(vec3 inputColor) { vec3 B = inputColor.rgb; @@ -298,14 +981,17 @@ vec3 FilmPass(vec3 inputColor) { B = clamp(B, 0.0, 1.); B = pow(vec3(B), vec3(Linearization)); - B = mix(H, B, Contrast); + B = mix(H, B, Filmic_Contrast); - vec3 LumCoeff = vec3(0.212656, 0.715158, 0.072186); + vec3 LumCoeff = vec3(0.2126, 0.7152, 0.0722); float A = dot(B.rgb, LumCoeff); vec3 D = vec3(A); B = pow(B, 1.0 / vec3(BaseGamma)); + float RedCurve = 1.0; + float GreenCurve = 1.0; + float BlueCurve = 1.0; float a = RedCurve; float b = GreenCurve; float c = BlueCurve; @@ -326,8 +1012,10 @@ vec3 FilmPass(vec3 inputColor) { vec3 Di = 1.0 - D; - D = mix(D, Di, Bleach); - + D = mix(D, Di, Filmic_Bleach); + float EffectGammaR = 1.0; + float EffectGammaG = 1.0; + float EffectGammaB = 1.0; D.r = pow(abs(D.r), 1.0 / EffectGammaR); D.g = pow(abs(D.g), 1.0 / EffectGammaG); D.b = pow(abs(D.b), 1.0 / EffectGammaB); @@ -347,7 +1035,7 @@ vec3 FilmPass(vec3 inputColor) { else C.b = (2.0 * D.b - 1.0) * (sqrt(B.b) - B.b) + B.b; - vec3 F = mix(B, C, Strength); + vec3 F = mix(B, C, Filmic_Strength); F = (1.0 / (1.0 + exp(-d * (F - 0.5))) - v) / (1.0 - 2.0 * v); @@ -379,10 +1067,43 @@ vec3 FilmPass(vec3 inputColor) { Cn = pow(max(Cn, 0), 1.0 / vec3(Linearization)); - vec3 Fn = mix(B, Cn, Strength); + vec3 Fn = mix(B, Cn, Filmic_Strength); return Fn; } +//DPX +const mat3 RGB = mat3( + 2.6714711726599600, -1.2672360578624100, -0.4109956021722270, + -1.0251070293466400, 1.9840911624108900, 0.0439502493584124, + 0.0610009456429445, -0.2236707508128630, 1.1590210416706100 +); +const mat3 XYZ = mat3( + 0.5003033835433160, 0.3380975732227390, 0.1645897795458570, + 0.2579688942747580, 0.6761952591447060, 0.0658358459823868, + 0.0234517888692628, 0.1126992737203000, 0.8668396731242010 +); +vec3 DPXPass(vec3 inputColor) +{ + vec3 color = inputColor; + + vec3 B = color; + B = B * (1.0 - DPX_Contrast) + (0.5 * DPX_Contrast); + vec3 Btemp = (1.0 / (1.0 + exp(RGB_Curve / 2.0))); + B = ((1.0 / (1.0 + exp(-RGB_Curve * (B - RGB_C)))) / (-2.0 * Btemp + 1.0)) + (-Btemp / (-2.0 * Btemp + 1.0)); + + float value = max(max(B.r, B.g), B.b); + vec3 Ztemp = B / value; + color = pow(abs(color), 1. / vec3(Colorfulness)); + + vec3 c0 = Ztemp * value; + c0 *= (XYZ, c0); + float luma = dot(c0, vec3(0.30, 0.59, 0.11)); + c0 = (1.0 - DPX_Saturation) * luma + DPX_Saturation * c0; + c0 *= (RGB, c0); + + return mix(color, c0, DPX_Strength); +} + //Lift Gamma Gain vec3 LiftGammaGainPass(vec3 colorInput) @@ -395,13 +1116,13 @@ vec3 LiftGammaGainPass(vec3 colorInput) color = color * (1.5 - 0.5 * RGB_Lift) + 0.5 * RGB_Lift - 0.5; color = clamp(color, 0.0, 1.0); //isn't strictly necessary, but doesn't cost performance. - // -- Gain -- + // -- Gain -- color *= RGB_Gain; // -- Gamma -- color = pow(color, 1.0 / RGB_Gamma); //Gamma - // -- Return output -- + // -- Return output -- return clamp(color, 0.0, 1.0); } @@ -428,7 +1149,7 @@ vec3 VibrancePass(vec3 color) { #define px (1.0/1280.0*uf_fragCoordScale.x) #define py (1.0/720.0*uf_fragCoordScale.y) -#define CoefLuma vec3(0.2126, 0.7152, 0.0722) +#define CoefLuma vec3(0.2126, 0.7152, 0.0722) float lumasharping(sampler2D tex, vec2 pos) { vec4 colorInput = texture(tex, pos); @@ -453,7 +1174,7 @@ float lumasharping(sampler2D tex, vec2 pos) { // -- Calculate the sharpening -- vec3 sharp = ori - blur_ori; //Subtracting the blurred image from the original image - // -- Adjust strength of the sharpening and clamp it-- + // -- Adjust strength of the sharpening and clamp it-- vec4 sharp_strength_luma_clamp = vec4(sharp_strength_luma * (0.5 / sharp_clamp), 0.5); //Roll part of the clamp into the dot float sharp_luma = clamp((dot(vec4(sharp, 1.0), sharp_strength_luma_clamp)), 0.0, 1.0); //Calculate the luma, adjust the strength, scale up and clamp @@ -500,161 +1221,104 @@ vec3 HDRPass(sampler2D tex, vec2 pos) { void main() { -vec4 R0f = vec4(0.0); -vec4 R1f = vec4(0.0); -vec4 R2f = vec4(0.0); -vec4 R123f = vec4(0.0); -vec4 R125f = vec4(0.0); -vec4 R126f = vec4(0.0); -vec4 R127f = vec4(0.0); -float backupReg0f, backupReg1f, backupReg2f, backupReg3f, backupReg4f; -vec4 PV0f = vec4(0.0), PV1f = vec4(0.0); -float PS0f = 0.0, PS1f = 0.0; -vec4 tempf = vec4(0.0); -float tempResultf; -int tempResulti; -ivec4 ARi = ivec4(0); -bool predResult = true; -vec3 cubeMapSTM; -int cubeMapFaceId; -R0f = passParameterSem0; -R1f = passParameterSem1; -R2f.xyzw = (texture(textureUnitPS2, R1f.xy).xyzw); -R1f.xyz = (texture(textureUnitPS0, R1f.xy).xyz); -// 0 -R127f.y = (mul_nonIEEE(R0f.w,R2f.z) + R1f.z); -PV0f.y = R127f.y; -R126f.z = (mul_nonIEEE(R0f.w,R2f.y) + R1f.y); -PV0f.z = R126f.z; -R127f.w = (mul_nonIEEE(R0f.w,R2f.x) + R1f.x); -PV0f.w = R127f.w; -R0f.w = R2f.w; -PS0f = R0f.w; -// 1 -PV1f.x = PV0f.w * intBitsToFloat(0x40c66666); -R127f.z = PV0f.y * intBitsToFloat(0x40c66666); -PV1f.z = R127f.z; -PV1f.w = PV0f.z * intBitsToFloat(0x40c66666); -// 2 -PV0f.x = PV1f.w + intBitsToFloat(0x3fd9999a); -PV0f.y = PV1f.x + intBitsToFloat(0x3fd9999a); -PV0f.z = PV1f.x + 0.5; -PV0f.w = PV1f.z + intBitsToFloat(0x3fd9999a); -R125f.z = PV1f.w + 0.5; -PS0f = R125f.z; -// 3 -R126f.x = (mul_nonIEEE(R127f.y,PV0f.w) + intBitsToFloat(0x3d75c28f)); -R126f.y = (mul_nonIEEE(R126f.z,PV0f.x) + intBitsToFloat(0x3d75c28f)); -R123f.z = (mul_nonIEEE(R127f.w,PV0f.y) + intBitsToFloat(0x3d75c28f)); -PV1f.z = R123f.z; -PV1f.w = R127f.z + 0.5; -R127f.x = mul_nonIEEE(R127f.w, PV0f.z); -PS1f = R127f.x; -// 4 -backupReg0f = R125f.z; -R125f.z = mul_nonIEEE(R127f.y, PV1f.w); -R127f.w = mul_nonIEEE(R126f.z, backupReg0f); -PS0f = 1.0 / PV1f.z; -// 5 -R126f.z = R127f.x * PS0f; -PS1f = 1.0 / R126f.y; -// 6 -R126f.y = R127f.w * PS1f; -PS0f = 1.0 / R126f.x; -// 7 -R126f.x = R125f.z * PS0f; -tempResultf = log2(R126f.z); -if( isinf(tempResultf) == true ) tempResultf = -3.40282347E+38F; -PS1f = tempResultf; -// 8 -R126f.z = PS1f * intBitsToFloat(0x400ccccd); -tempResultf = log2(R126f.y); -if( isinf(tempResultf) == true ) tempResultf = -3.40282347E+38F; -PS0f = tempResultf; -// 9 -R127f.w = PS0f * intBitsToFloat(0x400ccccd); -tempResultf = log2(R126f.x); -if( isinf(tempResultf) == true ) tempResultf = -3.40282347E+38F; -PS1f = tempResultf; -// 10 -R126f.x = PS1f * intBitsToFloat(0x400ccccd); -PS0f = exp2(R126f.z); -// 11 -R1f.x = (mul_nonIEEE(PS0f,intBitsToFloat(uf_remappedPS[0].x)) + intBitsToFloat(uf_remappedPS[0].y)); -PS1f = exp2(R127f.w); -// 12 -R1f.y = (mul_nonIEEE(PS1f,intBitsToFloat(uf_remappedPS[0].x)) + intBitsToFloat(uf_remappedPS[0].y)); -PS0f = exp2(R126f.x); -// 13 -R1f.z = (mul_nonIEEE(PS0f,intBitsToFloat(uf_remappedPS[0].x)) + intBitsToFloat(uf_remappedPS[0].y)); -R0f.xyz = (texture(textureUnitPS1, vec3(R1f.x,R1f.y,R1f.z)).xyz); -passPixelColor0 = vec4(R0f.x, R0f.y, R0f.z, R0f.w); - -// export -vec3 bloom = texture(textureUnitPS0, passParameterSem1.xy).xyz; + //Bloom + vec3 bloom = texture(textureUnitPS0, passParameterSem1.xy).xyz; #if (adjust_bloom == 1) -bloom *= bloomFactor; + bloom *= bloomFactor; #endif + + //HDR and LumaShapening #if (HDRpassing == 1) -passPixelColor0.xyz = HDRPass(textureUnitPS2, passParameterSem1.xy).xyz; -#endif + passPixelColor0.xyz = HDRPass(textureUnitPS2, passParameterSem1.xy).xyz; +#endif #if (HDRpassing == 0) -passPixelColor0.xyz = texture(textureUnitPS2, passParameterSem1.xy).xyz; + passPixelColor0.xyz = texture(textureUnitPS2, passParameterSem1.xy).xyz; #endif -#if (lumapassing == 1) +#if (lumapassing == 1) float smask = lumasharping(textureUnitPS2, passParameterSem1.xy); passPixelColor0.xyz += vec3(smask); #endif + + // Do not edit this vec3 color = (passPixelColor0.xyz); color += bloom; -#if (Tone_map == 1) + //++++++++++++++++++++++++++++++++++ + + // Tonemapping +#if (Tone_map == -1) + color = clamp(color*Exposure, 0.0, 1.0); +#elif (Tone_map == 0) + color = BotWToneMap(color); +#elif (Tone_map == 1) color = ReshadeToneMap(color); -#endif -#if (Tone_map == 2) +#elif (Tone_map == 2) color = linearToneMapping(color); -#endif -#if (Tone_map == 3) +#elif (Tone_map == 3) color = simpleReinhardToneMapping(color); -#endif -#if (Tone_map == 4) +#elif (Tone_map == 4) color = lumaBasedReinhardToneMapping(color); -#endif -#if (Tone_map == 5) +#elif (Tone_map == 5) color = whitePreservingLumaBasedReinhardToneMapping(color); -#endif -#if (Tone_map == 6) +#elif (Tone_map == 6) color = RomBinDaHouseToneMapping(color); -#endif -#if (Tone_map == 7) +#elif (Tone_map == 7) color = filmicToneMapping(color); -#endif -#if (Tone_map == 8) +#elif (Tone_map == 8) color = Uncharted2ToneMapping(color); -#endif -#if (tone_mapping == 9) +#elif (tone_mapping == 9) color = ACESFilm(color); #endif -#if (blacknwhitepass == 1) + + // Levels Control if we tone map to 16-235 , 0 - 255 or usr defined range. +#if (blacknwhitepass == 1) color = LevelsPass(color); #endif + + // Color matrix +#if (cmatrix == 1) + color = ColorMatrixPass(color); +#endif + + + // Post Processing +#if (Tech == 1) + color = TechnicolorPass(color); +#endif #if (Techine == 1) color = Technicolor2(color); #endif -#if (Tech == 1) - color = TechnicolorPass(color); +#if (post_process == 0) + color = BotWVibrance(color); #endif -#if (Filmicpass == 1) +#if (post_process == 1) + color = Contrasty(color); +#endif +#if (dpxpass == 1) + color = DPXPass(color); +#endif +#if (Filmicpass == 1) color = FilmPass(color); #endif +#if (lggpass == 1) + color = LiftGammaGainPass(color); +#endif #if (CurvesPss == 1) color = CurvesPass(color); #endif -#if (lggpass == 1) - color = LiftGammaGainPass(color); -#endif #if (vibpass == 1) color = VibrancePass(color); #endif -passPixelColor0 = vec4(color, R0f.w); -//passPixelColor0 = vec4(R0f.x, R0f.y, R0f.z, R0f.w); + passPixelColor0 = vec4(color, passParameterSem1.w); } +//########################################################## +// Possible problems +// Being below 1.3.3 will give you double-vision with recent graphic packs. Update to 1.3.0 or above. +// If you're experiencing any issues (due to having the previous Clarity shaders installed), please remove and redownload all of the BotW packs. +// Clarity GFX +// Credit to Jamie for main coding. +// Credit to Kiri coding & Reshade logic. +// Credit to Crementif for Help. +// Credit to Serfrost for preset values. +// Shader dumped from Cemu 1.11.2 from BotW 1.4.0 +// v 2.2 Final +// Add 1.4.0 support \ No newline at end of file diff --git a/Enhancement/Splatoon_FX/f502868a515bbfb4_00000000000003c9_ps.txt b/Enhancement/Splatoon_FX/f502868a515bbfb4_00000000000003c9_ps.txt new file mode 100644 index 00000000..98513a1f --- /dev/null +++ b/Enhancement/Splatoon_FX/f502868a515bbfb4_00000000000003c9_ps.txt @@ -0,0 +1,1323 @@ +#version 420 +#extension GL_ARB_texture_gather : enable +// shader f502868a515bbfb4 +//########################################################## +#define Preset 3 + // User Defined 0 + // Bruz Option 1 + // BSOD Option 2 + // Clarity Option 3 + // Contrasty Option 4 + // Serfrost Option 5 + // Sharpen Only Option 6 + // The Complaining Gamer Option 7 + // Filmic Preset Option 8 + // CellHunter Option 9 +//########################################################## +#if (Preset == 0) +// User Defined +//########################################################## +#define adjust_bloom 1 // 0: disable, 1: enable. +//BloomFactor +const float bloomFactor = 0.020; // Default is 0.020 (rough estimate based on Switch) + +#define HDRpassing 0 // 0: disable, 1: enable. +//Fake High Dynamic Range. +const float HDRPower = 1.00; // 0.0 to 8.0 Default 1.30. +const float radius1 = 1.00; // 0.0 to 8.0 Default 0.793 +const float radius2 = 0.80; // 0.0 to 8.0 Default 0.87 "Raising this seems to make the effect stronger and also brighter." + +#define lumapassing 0 // 0: disable, 1: enable. +//LumaShapening +const float sharp_strength = 0.35; //[0.10 to 3.00] Strength of the sharpening Default is 0.65 +const float sharp_clamp = 0.85; //[0.000 to 1.000] Limits maximum amount of sharpening a pixel recieves - Default is 0.035 + +//Advanced sharpening settings +const float offset_bias = 1.0; //[0.0 to 6.0] Offset bias adjusts the radius of the sampling pattern. + +#define Tone_map 0 // 0: disable, -1 to 9: enable. + // -1: disable, loss of bright detail/color but keep [0,1] intact + // 0: (Wii U) BotW original + // Reshade ToneMap Option 1 + // linearToneMapping Option 2 + // simpleReinhardToneMapping Option 3 + // lumaBasedReinhardToneMapping Option 4 + // whitePreservingLumaBasedReinhardToneMapping Option 5 + // RomBinDaHouseToneMapping Option 6 + // filmicToneMapping Option 7 + // Uncharted2ToneMapping Option 8 + // ACES Filmic Option 9 + // Reshade ToneMap Controls / "Contrasty" Parameters +const float Exposure = 1.17; // [0.0, 1.0+] Adjust exposure +const float Bleach = 0.4; // "More bleach means more contrasted and less colorful image" min -0.5 max 1.0 Default 0.0 +const float Gamma = 1.00; // "Adjust midtones. 1.000 is neutral. This setting does exactly the same as the one in Lift Gamma Gain, only with less control." +const float defog = 0.00; // Default is 0.0 //How much of the overall color you want removed form the values of FogColor. +vec3 FogColor = vec3(1.0, 1.0, 1.0); // Color you want to Add or Remove 0.25 would add .25 percent of that color 1.25 would remove .25 percent of the color." +const float sat = 0.000; // "Adjust saturation" min -1.0 max 1.0 Default 0.0 +const float crushContrast = 0.000; // 0.0 is neutral. Use small increments, loss of shadow detail + +#define post_process 0 +//----------------"BotW original" vibrance adjust-------------// +const float satFactor = 0.25; // 0.18 is neutral. Experimental, adjust native saturation +//---------------------------------------------------------------// + +#define blacknwhitepass 0 // 0: disable, 1: enable. +// Levels Control +const int BlackPoint = 16; // [0, 255] The black point is the new black - literally. Everything darker than this will become completely black +const int WhitePoint = 235; // [0, 255] The new white point. Everything brighter than this becomes completely white + +#define lggpass 0 // 0: disable, 1: enable. +//Lift Gamma Gain +vec3 RGB_Lift = vec3(1.000, 1.000, 1.000); // [0.000 to 2.000] Adjust shadows for Red, Green and Blue. +vec3 RGB_Gamma = vec3(1.000, 1.000, 1.000); // [0.000 to 2.000] Adjust midtones for Red, Green and Blue +vec3 RGB_Gain = vec3(1.000, 1.000, 1.000); // [0.000 to 2.000] Adjust highlights for Red, Green and Blue + // Note that a value of 1.0 is a neutral setting that leave the color unchanged. + +#define vibpass 0 // 0: disable, 1: enable. +//VibrancePass +const float Vibrance = 0.150; // Default [0.150] "Intelligently saturates (or desaturates if you use negative values) the pixels depending on their original saturation." +vec3 VibranceRGBBalance = vec3(1.0, 1.0, 1.0); // "A per channel multiplier to the Vibrance strength so you can give more boost to certain colors over others."; + +#define Tech 0 // 0: disable, 1: enable. +//Technicolor +const float Power = 4.0; // Min 0.0 Max 8.0 Default 4.0 +vec3 RGBNegativeAmount = vec3(0.88, 0.88, 0.88); +float Strength = 0.20; // Min 0.0 Max 1.0 Default 0.4 + +#define Techine 0 // 0: disable, 1: enable. +//Technicolor2 +const float Technicolor2_Red_Strength = 0.02; // "Higher means darker and more intense colors." Default 0.2 +const float Technicolor2_Green_Strength = 0.02; // "Higher means darker and more intense colors." Default 0.2 +const float Technicolor2_Blue_Strength = 0.02; // "Higher means darker and more intense colors." Default 0.2 +const float Technicolor2_Brightness = 1.00; // "Higher means brighter image." min 0.5 max 1.5 Default 1.0 +const float Technicolor2_Strength = 1.00; // [Default is 1.0] +const float Technicolor2_Saturation = 1.00; // Default is 1.0 min 0.0 max 1.5 "Additional saturation control since this effect tends to oversaturate the image." + +#define cmatrix 0 +//Color Matrix +vec3 ColorMatrix_Red = vec3(0.817, 0.183, 0.000); +vec3 ColorMatrix_Green = vec3(0.333, 0.667, 0.000); +vec3 ColorMatrix_Blue = vec3(0.000, 0.125, 0.875); +float CM_Strength = 1.0; + +//Curves Contrast +#define CurvesPss 0 // 0: disable, 1: enable. +const float Contrast = 0.65; // Default 0.65 min -1.0 max = 1.0 "The amount of contrast you want." + +#define Filmicpass 0 // 0: disable, 1: enable. +//Filmic Pass +const float Filmic_Contrast = 1.0; // Default 1.0 min 0.5 max 2.0 +const float Filmic_Bleach = 0.0; // "More bleach means more contrasted and less colorful image" min -0.5 max 1.0 Default 0.0 +const float Saturation = -0.15; // min -1.0 max 1.0 Default -0.15 + +const float Filmic_Strength = 0.85; // "Strength of the color curve altering"; min 0.0 max 1.5 Default 0.85 +const float Fade = 0.4; // "Decreases contrast to imitate faded image" min 0.0 max 0.6 Default 0.4 +const float Linearization = 0.5; // min 0.5 max 2.0 Default 0.5 + +const float BaseCurve = 1.5; // min 0.0 max 2.0 Default 1.5 +const float BaseGamma = 1.00; // min 0.7 max 2.0 Default 1.0 +const float EffectGamma = 0.68; // min 0.0 max 2.0 Default 0.68 + +#define dpxpass 0 +//DPX +vec3 RGB_Curve = vec3(8.0, 8.0, 8.0); +vec3 RGB_C = vec3(0.36, 0.36, 0.34); + +float DPX_Contrast = 0.1; +float DPX_Saturation = 3.0; +float Colorfulness = 2.5; + +float DPX_Strength = 0.20; +//########################################################### +//Do not edit under this line. +//Presets +#elif (Preset == 1) + #define adjust_bloom 1 + const float bloomFactor = 0.30; + #define HDRpassing 0 + float HDRPower = 1.00; + float radius1 = 1.00; + float radius2 = 0.80; + #define lumapassing 0 + float sharp_strength = 0.45; + float sharp_clamp = 0.085; + float offset_bias = 1.0; + #define Tone_map 8 + const float Exposure = 1.17; + const float Bleach = 0.4; + const float Gamma = 1.00; + const float defog = 0.00; + vec3 FogColor = vec3(1.0, 1.0, 1.0); + const float sat = 0.000; + const float crushContrast = 0.000; + #define post_process 1 + const float satFactor = 0.25; + #define blacknwhitepass 1 + const int BlackPoint = 1; + const int WhitePoint = 220; + #define lggpass 1 + vec3 RGB_Lift = vec3(1.000, 1.000, 1.000); + vec3 RGB_Gamma = vec3(1.000, 1.000, 1.000); + vec3 RGB_Gain = vec3(1.000, 1.000, 1.000); + #define vibpass 0 + const float Vibrance = 0.150; + vec3 VibranceRGBBalance = vec3(1.0, 1.0, 1.0); + #define Tech 1 + const float Power = 8.0; + vec3 RGBNegativeAmount = vec3(0.88, 0.88, 0.88); + float Strength = 0.3; + #define Techine 1 + float Technicolor2_Red_Strength = -0.05; + float Technicolor2_Green_Strength = -0.1; + float Technicolor2_Blue_Strength = 0.07; + float Technicolor2_Brightness = 0.0; + float Technicolor2_Strength = 2.0; + float Technicolor2_Saturation = 1.3; //1.13 to completely fix lava + #define cmatrix 0 + vec3 ColorMatrix_Red = vec3(0.817, 0.183, 0.000); + vec3 ColorMatrix_Green = vec3(0.333, 0.667, 0.000); + vec3 ColorMatrix_Blue = vec3(0.000, 0.125, 0.875); + float CM_Strength = 1.0; + #define CurvesPss 0 + const float Contrast = 0.65; + #define Filmicpass 1 + const float Filmic_Strength = 0.60; + const float Filmic_Contrast = 1.03; + const float Fade = 0.0; + const float Linearization = 1.0; + const float Filmic_Bleach = 0.0; + const float Saturation = -0.3; + const float BaseCurve = 1.5; + const float BaseGamma = 1.0; + const float EffectGamma = 0.68; + #define dpxpass 0 + vec3 RGB_Curve = vec3(8.0, 8.0, 8.0); + vec3 RGB_C = vec3(0.36, 0.36, 0.34); + float DPX_Contrast = 0.1; + float DPX_Saturation = 3.0; + float Colorfulness = 2.5; + float DPX_Strength = 0.20; +#elif (Preset == 2) + #define adjust_bloom 1 + const float bloomFactor = 0.010; + #define HDRpassing 1 + const float HDRPower = 1.085; + const float radius1 = 0.793; + const float radius2 = 0.87; + #define lumapassing 1 + const float sharp_strength = 0.25; + const float sharp_clamp = 0.085; + const float offset_bias = 1.0; + #define Tone_map 8 + const float Exposure = 0.6; + const float Bleach = 0.3; + const float Gamma = 1.00; + const float defog = 0.004; + vec3 FogColor = vec3(1.0, 1.5, 1.7); + const float sat = 0.050; + const float crushContrast = 0.000; + #define post_process 0 + const float satFactor = 0.25; + #define blacknwhitepass 0 + const int BlackPoint = 8; + const int WhitePoint = 235; + #define lggpass 1 + vec3 RGB_Lift = vec3(0.994, 0.994, 0.994); + vec3 RGB_Gamma = vec3(1.0, 0.990, 1.0); + vec3 RGB_Gain = vec3(1.0, 0.990, 1.00); + #define vibpass 1 + const float Vibrance = 0.113; + vec3 VibranceRGBBalance = vec3(1.0, 1.0, 1.0); + #define Tech 0 + const float Power = 4.0; + vec3 RGBNegativeAmount = vec3(0.88, 0.88, 0.88); + float Strength = 0.20; + #define Techine 0 + const float Technicolor2_Red_Strength = 0.000; + const float Technicolor2_Green_Strength = 0.000; + const float Technicolor2_Blue_Strength = 0.000; + const float Technicolor2_Brightness = 1.0; + const float Technicolor2_Strength = 0.40; + const float Technicolor2_Saturation = 0.70; + #define cmatrix 0 + vec3 ColorMatrix_Red = vec3(0.817, 0.183, 0.000); + vec3 ColorMatrix_Green = vec3(0.333, 0.667, 0.000); + vec3 ColorMatrix_Blue = vec3(0.000, 0.125, 0.875); + float CM_Strength = 1.0; + #define CurvesPss 0 + const float Contrast = 0.65; + #define Filmicpass 1 + const float Filmic_Contrast = 1.0; + const float Filmic_Bleach = 0.0; + const float Saturation = -0.15; + const float Filmic_Strength = 0.85; + const float Fade = 0.4; + const float Linearization = 0.5; + const float BaseCurve = 1.5; + const float BaseGamma = 0.7; + const float EffectGamma = 0.68; + #define dpxpass 0 + vec3 RGB_Curve = vec3(8.0, 8.0, 8.0); + vec3 RGB_C = vec3(0.36, 0.36, 0.34); + float DPX_Contrast = 0.1; + float DPX_Saturation = 3.0; + float Colorfulness = 2.5; + float DPX_Strength = 0.20; +#elif (Preset == 3) + #define adjust_bloom 1 + const float bloomFactor = 0.020; + #define HDRpassing 1 + const float HDRPower = 1.00; + const float radius1 = 1.00; + const float radius2 = 0.80; + #define lumapassing 1 + const float sharp_strength = 0.35; + const float sharp_clamp = 0.85; + const float offset_bias = 1.0; + #define Tone_map 8 + const float Exposure = 1.17; + const float Bleach = 0.4; + const float Gamma = 1.00; + const float defog = 0.00; + vec3 FogColor = vec3(1.0, 1.0, 1.0); + const float sat = 0.000; + const float crushContrast = 0.000; + #define post_process 1 + const float satFactor = 0.25; + #define blacknwhitepass 0 + const int BlackPoint = 16; + const int WhitePoint = 235; + #define lggpass 1 + vec3 RGB_Lift = vec3(0.980, 0.980, 0.980); + vec3 RGB_Gamma = vec3(1.000, 1.000, 1.000); + vec3 RGB_Gain = vec3(1.000, 1.000, 1.000); + #define vibpass 0 + const float Vibrance = 0.150; + vec3 VibranceRGBBalance = vec3(1.0, 1.0, 1.0); + #define Tech 0 + const float Power = 4.0; + vec3 RGBNegativeAmount = vec3(0.88, 0.88, 0.88); + float Strength = 0.20; + #define Techine 0 + const float Technicolor2_Red_Strength = 0.02; + const float Technicolor2_Green_Strength = 0.02; + const float Technicolor2_Blue_Strength = 0.02; + const float Technicolor2_Brightness = 1.00; + const float Technicolor2_Strength = 1.00; + const float Technicolor2_Saturation = 1.00; + #define cmatrix 0 + vec3 ColorMatrix_Red = vec3(0.817, 0.183, 0.000); + vec3 ColorMatrix_Green = vec3(0.333, 0.667, 0.000); + vec3 ColorMatrix_Blue = vec3(0.000, 0.125, 0.875); + float CM_Strength = 1.0; + #define CurvesPss 0 + const float Contrast = 0.65; + #define Filmicpass 0 + const float Filmic_Contrast = 1.0; + const float Filmic_Bleach = 0.0; + const float Saturation = -0.15; + const float Filmic_Strength = 0.85; + const float Fade = 0.4; + const float Linearization = 0.5; + const float BaseCurve = 1.5; + const float BaseGamma = 1.00; + const float EffectGamma = 0.68; + #define dpxpass 1 + vec3 RGB_Curve = vec3(8.0, 8.0, 8.0); + vec3 RGB_C = vec3(0.36, 0.36, 0.34); + float DPX_Contrast = 0.1; + float DPX_Saturation = 0.0; + float Colorfulness = 1.0; + float DPX_Strength = 0.20; +#elif (Preset == 4) + #define adjust_bloom 1 + const float bloomFactor = 0.020; + #define HDRpassing 0 + const float HDRPower = 1.00; + const float radius1 = 1.00; + const float radius2 = 0.80; + #define lumapassing 0 + const float sharp_strength = 0.35; + const float sharp_clamp = 0.85; + const float offset_bias = 1.0; + #define Tone_map 1 + const float Exposure = 1.17; + const float Bleach = 0.3; + const float Gamma = 0.810; + const float defog = 0.00; + vec3 FogColor = vec3(1.0, 1.0, 1.0); + const float sat = 0.000; + const float crushContrast = 0.000; + #define post_process 1 + const float satFactor = 0.25; + #define blacknwhitepass 0 + const int BlackPoint = 16; + const int WhitePoint = 235; + #define lggpass 0 + vec3 RGB_Lift = vec3(1.000, 1.000, 1.000); + vec3 RGB_Gamma = vec3(1.000, 1.000, 1.000); + vec3 RGB_Gain = vec3(1.000, 1.000, 1.000); + #define vibpass 0 + const float Vibrance = 0.150; + vec3 VibranceRGBBalance = vec3(1.0, 1.0, 1.0); + #define Tech 0 + const float Power = 4.0; + vec3 RGBNegativeAmount = vec3(0.88, 0.88, 0.88); + float Strength = 0.20; + #define Techine 0 + const float Technicolor2_Red_Strength = 0.02; + const float Technicolor2_Green_Strength = 0.02; + const float Technicolor2_Blue_Strength = 0.02; + const float Technicolor2_Brightness = 1.00; + const float Technicolor2_Strength = 1.00; + const float Technicolor2_Saturation = 1.00; + #define cmatrix 0 + vec3 ColorMatrix_Red = vec3(0.817, 0.183, 0.000); + vec3 ColorMatrix_Green = vec3(0.333, 0.667, 0.000); + vec3 ColorMatrix_Blue = vec3(0.000, 0.125, 0.875); + float CM_Strength = 1.0; + #define CurvesPss 1 + const float Contrast = 0.65; + #define Filmicpass 0 + const float Filmic_Contrast = 1.0; + const float Filmic_Bleach = 0.0; + const float Saturation = -0.15; + const float Filmic_Strength = 0.85; + const float Fade = 0.4; + const float Linearization = 0.5; + const float BaseCurve = 1.5; + const float BaseGamma = 1.00; + const float EffectGamma = 0.68; + #define dpxpass 0 + vec3 RGB_Curve = vec3(8.0, 8.0, 8.0); + vec3 RGB_C = vec3(0.36, 0.36, 0.34); + float DPX_Contrast = 0.1; + float DPX_Saturation = 3.0; + float Colorfulness = 2.5; + float DPX_Strength = 0.20; +#elif (Preset == 5) + #define adjust_bloom 1 + const float bloomFactor = 0.40; + #define HDRpassing 1 + const float HDRPower = 1.20; + const float radius1 = 0.793; + const float radius2 = 0.87; + #define lumapassing 0 + const float sharp_strength = 0.45; + const float sharp_clamp = 0.85; + const float offset_bias = 1.0; + #define Tone_map 8 + const float Exposure = 1.17; + const float Bleach = 0.0; + const float Gamma = 0.98; + const float defog = 1.00; + vec3 FogColor = vec3(1.0, 1.0, 1.0); + const float sat = 0.00; + const float crushContrast = 0.00; + #define post_process 0 + const float satFactor = 0.07; + #define blacknwhitepass 1 + const int BlackPoint = 2; + const int WhitePoint = 300; + #define lggpass 1 + vec3 RGB_Lift = vec3(1.027, 1.027, 1.027); + vec3 RGB_Gamma = vec3(0.83, 0.83, 0.83); + vec3 RGB_Gain = vec3(1.10, 1.10, 1.10); + #define vibpass 1 + const float Vibrance = 0.15; + vec3 VibranceRGBBalance = vec3(1.0, 1.0, 1.0); + #define Tech 0 + const float Power = 5.0; + vec3 RGBNegativeAmount = vec3(0.88, 0.88, 0.88); + float Strength = 0.10; + #define Techine 1 + float Technicolor2_Red_Strength = -0.09; + float Technicolor2_Green_Strength = -0.09; + float Technicolor2_Blue_Strength = -0.00; + float Technicolor2_Brightness = 0.4; + float Technicolor2_Strength = 1.2; + float Technicolor2_Saturation = 1.1; + #define cmatrix 0 + vec3 ColorMatrix_Red = vec3(0.817, 0.183, 0.000); + vec3 ColorMatrix_Green = vec3(0.333, 0.667, 0.000); + vec3 ColorMatrix_Blue = vec3(0.000, 0.125, 0.875); + float CM_Strength = 1.0; + #define CurvesPss 0 + const float Contrast = 0.0; + #define Filmicpass 1 + const float Filmic_Contrast = 1.0; + const float Filmic_Bleach = 0.0; + const float Saturation = -0.17; + const float Filmic_Strength = 0.48; + const float Fade = 0.08; + const float Linearization = 1.0; + const float BaseCurve = 1.0; + const float BaseGamma = 1.0; + const float EffectGamma = 1.68; + #define dpxpass 0 + vec3 RGB_Curve = vec3(8.0, 8.0, 8.0); + vec3 RGB_C = vec3(0.36, 0.36, 0.34); + float DPX_Contrast = 0.1; + float DPX_Saturation = 3.0; + float Colorfulness = 1.0; + float DPX_Strength = 0.20; +#elif (Preset == 6) + #define adjust_bloom 0 + const float bloomFactor = 0.20; + #define HDRpassing 0 + const float HDRPower = 1.00; + const float radius1 = 1.00; + const float radius2 = 0.80; + #define lumapassing 1 + const float sharp_strength = 1.70; + const float sharp_clamp = 0.35; + const float offset_bias = 1.0; + #define Tone_map 0 + const float Exposure = 1.17; + const float Bleach = 0.4; + const float Gamma = 1.00; + const float defog = 0.00; + vec3 FogColor = vec3(1.0, 1.0, 1.0); + const float sat = 0.000; + const float crushContrast = 0.000; + #define post_process 0 + const float satFactor = 0.25; + #define blacknwhitepass 0 + const int BlackPoint = 16; + const int WhitePoint = 235; + #define lggpass 0 + vec3 RGB_Lift = vec3(1.000, 1.000, 1.000); + vec3 RGB_Gamma = vec3(1.000, 1.000, 1.000); + vec3 RGB_Gain = vec3(1.000, 1.000, 1.000); + #define vibpass 0 + const float Vibrance = 0.150; + vec3 VibranceRGBBalance = vec3(1.0, 1.0, 1.0); + #define Tech 0 + const float Power = 4.0; + vec3 RGBNegativeAmount = vec3(0.88, 0.88, 0.88); + float Strength = 0.20; + #define Techine 0 + const float Technicolor2_Red_Strength = 0.02; + const float Technicolor2_Green_Strength = 0.02; + const float Technicolor2_Blue_Strength = 0.02; + const float Technicolor2_Brightness = 1.00; + const float Technicolor2_Strength = 1.00; + const float Technicolor2_Saturation = 1.00; + #define cmatrix 0 + vec3 ColorMatrix_Red = vec3(0.817, 0.183, 0.000); + vec3 ColorMatrix_Green = vec3(0.333, 0.667, 0.000); + vec3 ColorMatrix_Blue = vec3(0.000, 0.125, 0.875); + float CM_Strength = 1.0; + #define CurvesPss 0 + const float Contrast = 0.65; + #define Filmicpass 0 + const float Filmic_Contrast = 1.0; + const float Filmic_Bleach = 0.0; + const float Saturation = -0.15; + const float Filmic_Strength = 0.85; + const float Fade = 0.4; + const float Linearization = 0.5; + const float BaseCurve = 1.5; + const float BaseGamma = 1.00; + const float EffectGamma = 0.68; + #define dpxpass 0 + vec3 RGB_Curve = vec3(8.0, 8.0, 8.0); + vec3 RGB_C = vec3(0.36, 0.36, 0.34); + float DPX_Contrast = 0.1; + float DPX_Saturation = 3.0; + float Colorfulness = 2.5; + float DPX_Strength = 0.20; +#elif (Preset == 7) + #define adjust_bloom 1 + const float bloomFactor = 0.33; + #define HDRpassing 1 + const float HDRPower = 1.020; + const float radius1 = 0.793; + const float radius2 = 0.87; + #define lumapassing 1 + const float sharp_strength = 0.25; + const float sharp_clamp = 0.85; + const float offset_bias = 1.0; + #define Tone_map 8 + const float Exposure = 1.17; + const float Bleach = 0.4; + const float Gamma = 1.00; + const float defog = 0.00; + vec3 FogColor = vec3(1.0, 1.0, 1.0); + const float sat = 0.000; + const float crushContrast = 0.000; + #define post_process 0 + const float satFactor = 0.25; + #define blacknwhitepass 0 + const int BlackPoint = 16; + const int WhitePoint = 235; + #define lggpass 1 + vec3 RGB_Lift = vec3(1.000, 1.000, 1.000); + vec3 RGB_Gamma = vec3(0.600, 0.600, 0.600); + vec3 RGB_Gain = vec3(1.000, 1.000, 1.000); + #define vibpass 1 + const float Vibrance = 0.150; + vec3 VibranceRGBBalance = vec3(1.0, 1.0, 1.0); + #define Tech 0 + const float Power = 4.0; + vec3 RGBNegativeAmount = vec3(0.88, 0.88, 0.88); + float Strength = 0.20; + #define Techine 1 + const float Technicolor2_Red_Strength = 0.000; + const float Technicolor2_Green_Strength = 0.000; + const float Technicolor2_Blue_Strength = 0.000; + const float Technicolor2_Brightness = 1.0; + const float Technicolor2_Strength = 0.40; + const float Technicolor2_Saturation = 0.51; + #define cmatrix 0 + vec3 ColorMatrix_Red = vec3(0.817, 0.183, 0.000); + vec3 ColorMatrix_Green = vec3(0.333, 0.667, 0.000); + vec3 ColorMatrix_Blue = vec3(0.000, 0.125, 0.875); + float CM_Strength = 1.0; + #define CurvesPss 1 + const float Contrast = 0.65; + #define Filmicpass 0 + const float Filmic_Contrast = 1.0; + const float Filmic_Bleach = 0.0; + const float Saturation = -0.15; + const float Filmic_Strength = 0.85; + const float Fade = 0.4; + const float Linearization = 0.5; + const float BaseCurve = 1.5; + const float BaseGamma = 1.00; + const float EffectGamma = 0.68; + #define dpxpass 0 + vec3 RGB_Curve = vec3(8.0, 8.0, 8.0); + vec3 RGB_C = vec3(0.36, 0.36, 0.34); + float DPX_Contrast = 0.1; + float DPX_Saturation = 3.0; + float Colorfulness = 2.5; + float DPX_Strength = 0.20; +#elif (Preset == 8) + #define adjust_bloom 1 + const float bloomFactor = 0.020; + #define HDRpassing 1 + const float HDRPower = 1.20; + const float radius1 = 1.00; + const float radius2 = 0.80; + #define lumapassing 1 + const float sharp_strength = 0.35; + const float sharp_clamp = 0.85; + const float offset_bias = 1.0; + #define Tone_map 8 + const float Exposure = 1.17; + const float Bleach = 0.4; + const float Gamma = 1.00; + const float defog = 0.00; + vec3 FogColor = vec3(1.0, 1.0, 1.0); + const float sat = 0.000; + const float crushContrast = 0.000; + #define post_process 1 + const float satFactor = 0.25; + #define blacknwhitepass 0 + const int BlackPoint = 16; + const int WhitePoint = 235; + #define lggpass 0 + vec3 RGB_Lift = vec3(0.990, 0.990, 0.990); + vec3 RGB_Gamma = vec3(1.000, 1.000, 1.000); + vec3 RGB_Gain = vec3(1.000, 1.000, 1.000); + #define vibpass 1 + const float Vibrance = 0.150; + vec3 VibranceRGBBalance = vec3(1.0, 1.0, 1.0); + #define Tech 0 + const float Power = 4.0; + vec3 RGBNegativeAmount = vec3(0.88, 0.88, 0.88); + float Strength = 0.20; + #define Techine 0 + const float Technicolor2_Red_Strength = 0.02; + const float Technicolor2_Green_Strength = 0.02; + const float Technicolor2_Blue_Strength = 0.02; + const float Technicolor2_Brightness = 1.00; + const float Technicolor2_Strength = 1.00; + const float Technicolor2_Saturation = 1.00; + #define cmatrix 0 + vec3 ColorMatrix_Red = vec3(0.817, 0.183, 0.000); + vec3 ColorMatrix_Green = vec3(0.333, 0.667, 0.000); + vec3 ColorMatrix_Blue = vec3(0.000, 0.125, 0.875); + float CM_Strength = 1.0; + #define CurvesPss 1 + const float Contrast = 0.65; + #define Filmicpass 1 + const float Filmic_Contrast = 1.0; + const float Filmic_Bleach = 0.0; + const float Saturation = -0.15; + const float Filmic_Strength = 0.85; + const float Fade = 0.4; + const float Linearization = 0.5; + const float BaseCurve = 1.5; + const float BaseGamma = 1.00; + const float EffectGamma = 0.68; + #define dpxpass 1 + vec3 RGB_Curve = vec3(8.0, 8.0, 8.0); + vec3 RGB_C = vec3(0.36, 0.36, 0.34); + float DPX_Contrast = 0.1; + float DPX_Saturation = 2.0; + float Colorfulness = 1.5; + float DPX_Strength = 0.20; +#elif (Preset == 9) + #define adjust_bloom 1 + const float bloomFactor = 0.445; + #define HDRpassing 1 + const float HDRPower = 1.000; + const float radius1 = 1.135; + const float radius2 = 1.000; + #define lumapassing 1 + const float sharp_strength = 0.65; + const float sharp_clamp = 0.75; + const float offset_bias = 1.0; + #define Tone_map 8 + const float Exposure = 1.17; + const float Bleach = 0.0; + const float Gamma = 1.00; + const float defog = 0.00; + vec3 FogColor = vec3(1.0, 1.0, 1.0); + const float sat = 0.000; + const float crushContrast = 0.000; + #define post_process 0 + const float satFactor = 0.25; + #define blacknwhitepass 0 + const int BlackPoint = 16; + const int WhitePoint = 215; + #define lggpass 1 + vec3 RGB_Lift = vec3(0.985, 0.960, 1.005); + vec3 RGB_Gamma = vec3(0.985, 0.960, 1.005); + vec3 RGB_Gain = vec3(0.985, 0.960, 1.005); + #define vibpass 1 + const float Vibrance = 0.245; + vec3 VibranceRGBBalance = vec3(1.00, 1.00, 1.00); + #define Tech 0 + const float Power = 4.0; + vec3 RGBNegativeAmount = vec3(0.88, 0.88, 0.88); + float Strength = 0.20; + #define Techine 0 + const float Technicolor2_Red_Strength = 0.02; + const float Technicolor2_Green_Strength = 0.02; + const float Technicolor2_Blue_Strength = 0.02; + const float Technicolor2_Brightness = 1.00; + const float Technicolor2_Strength = 1.00; + const float Technicolor2_Saturation = 1.00; + #define cmatrix 0 + vec3 ColorMatrix_Red = vec3(0.817, 0.183, 0.000); + vec3 ColorMatrix_Green = vec3(0.333, 0.667, 0.000); + vec3 ColorMatrix_Blue = vec3(0.000, 0.125, 0.875); + float CM_Strength = 1.0; + #define CurvesPss 1 + const float Contrast = 0.245; + #define Filmicpass 0 + const float Filmic_Contrast = 0.97; + const float Filmic_Bleach = 0.0; + const float Saturation = -0.15; + const float Filmic_Strength = 0.65; + const float Fade = 0.2; + const float Linearization = 0.7; + const float BaseCurve = 1.5; + const float BaseGamma = 0.90; + const float EffectGamma = 0.68; + #define dpxpass 0 + vec3 RGB_Curve = vec3(8.0, 8.0, 8.0); + vec3 RGB_C = vec3(0.36, 0.36, 0.34); + float DPX_Contrast = 0.1; + float DPX_Saturation = 3.0; + float Colorfulness = 2.5; + float DPX_Strength = 0.20; +#endif +//########################################################### +uniform ivec4 uf_remappedPS[1]; +layout(binding = 0) uniform sampler2D textureUnitPS0; // Bloom +layout(binding = 1) uniform sampler2D textureUnitPS1;// HDR LumaShapening. +layout(location = 1) in vec4 passParameterSem1; +layout(location = 0) out vec4 passPixelColor0; +uniform vec2 uf_fragCoordScale; + +//ToneMapping + +vec3 linearToneMapping(vec3 color) +{ + float exposure = 1.; + color = clamp(exposure * color, 0., 1.); + color = pow(color, vec3(1. / Gamma)); + return color; +} + +vec3 simpleReinhardToneMapping(vec3 color) +{ + float exposure = 1.5; + color *= exposure / (1. + color / exposure); + color = pow(color, vec3(1. / Gamma)); + return color; +} + +vec3 lumaBasedReinhardToneMapping(vec3 color) +{ + float luma = dot(color, vec3(0.2126, 0.7152, 0.0722)); + float toneMappedLuma = luma / (1. + luma); + color *= toneMappedLuma / luma; + color = pow(color, vec3(1. / Gamma)); + return color; +} + +vec3 whitePreservingLumaBasedReinhardToneMapping(vec3 color) +{ + float white = 2.; + float luma = dot(color, vec3(0.2126, 0.7152, 0.0722)); + float toneMappedLuma = luma * (1. + luma / (white*white)) / (1. + luma); + color *= toneMappedLuma / luma; + color = pow(color, vec3(1. / Gamma)); + return color; +} + +vec3 RomBinDaHouseToneMapping(vec3 color) +{ + color = exp(-1.0 / (2.72*color + 0.15)); + color = pow(color, vec3(1. / Gamma)); + return color; +} + +vec3 filmicToneMapping(vec3 color) +{ + color = max(vec3(0.), color - vec3(0.004)); + color = (color * (6.2 * color + .5)) / (color * (6.2 * color + 1.7) + 0.06); + return color; +} + +vec3 Uncharted2ToneMapping(vec3 color) +{ + float A = 0.15; + float B = 0.50; + float C = 0.10; + float D = 0.20; + float E = 0.02; + float F = 0.30; + float W = 11.2; + float exposure = 2.; + color *= exposure; + color = ((color * (A * color + C * B) + D * E) / (color * (A * color + B) + D * F)) - E / F; + float white = ((W * (A * W + C * B) + D * E) / (W * (A * W + B) + D * F)) - E / F; + color /= white; + color = pow(color, vec3(1. / Gamma)); + return color; +} + +vec3 ReshadeToneMap(vec3 inputColor) { + vec3 color = inputColor; + color = clamp(color - defog * FogColor * 2.55, 0.0, 1.0); // defog + color *= Exposure / (1.0 + color / Exposure); + color = pow(color, vec3(1. / Gamma)); // Gamma + + const vec3 coefLuma = vec3(0.2126, 0.7152, 0.0722); + float lum = dot(coefLuma, color); + + float L = clamp(10.0 * (lum - 0.45), 0.0, 1.0); + vec3 A2 = Bleach * color; + + vec3 result1 = 2.0f * color * lum; + vec3 result2 = 1.0f - 2.0f * (1.0f - lum) * (1.0f - color); + + vec3 newColor = mix(result1, result2, L); + vec3 mixRGB = A2 * newColor; + color += ((1.0f - A2) * mixRGB); + + vec3 middlegray = vec3(dot(color, vec3(1.0 / 3.0))); + vec3 diffcolor = color - middlegray; + + color = (color + diffcolor * sat) / (1 + (diffcolor * sat)); // saturation + + return color; +} + +float getL601(vec3 rgb) { + return dot(rgb, vec3(0.2989, 0.5866, 0.1145)); +} + +float getL709(vec3 rgb) { + return dot(rgb, vec3(0.2126, 0.7152, 0.0722)); +} + +vec3 BotWToneMap(vec3 color) { + float Lumn = getL601(color); + vec4 exptm = 1.0 - exp(-vec4(color, Lumn)); + vec3 cpre = exptm.w / Lumn * color; + vec3 colorldr = mix(cpre, exptm.rgb, vec3(pow(exptm.w, 2.0)));//refine + return colorldr; +} +vec3 ACESFilm(vec3 color) { + color *= Exposure; + float Lumn = getL709(color); + vec4 tm = vec4(color, Lumn); + tm = (tm*(2.51*tm + 0.03)) / (tm*(2.43*tm + 0.59) + 0.14); // tonemap + vec3 cpre = tm.w / Lumn * color; + vec3 colorldr = mix(cpre, tm.rgb, vec3(pow(tm.w, 2.0)));//refine + return colorldr; +} + +//Curves + +vec3 CurvesPass(vec3 inputColor) { + vec3 colorInput = inputColor; + float Contrast_blend = Contrast * 2.0; //I multiply by two to give it a strength closer to the other curves. + vec3 x = colorInput.rgb; //if the curve should be applied to both Luma and Chroma + x = x * (x * (1.5 - x) + 0.5); //horner form - fastest version + vec3 color = x; //if the curve should be applied to both Luma and Chroma + colorInput.rgb = mix(colorInput.rgb, color, Contrast_blend); //Blend by Contrast + return colorInput; +} + +//TECHNICOLOR2 + +vec3 Technicolor2(vec3 inputColor) { + vec3 color = inputColor; + vec3 Color_Strength = vec3(Technicolor2_Red_Strength, Technicolor2_Green_Strength, Technicolor2_Blue_Strength); + vec3 source = color; + vec3 temp = 1.0 - source; + vec3 target = temp.grg; + vec3 target2 = temp.bbr; + vec3 temp2 = source * target; + temp2 *= target2; + + temp = temp2 * Color_Strength; + temp2 *= Technicolor2_Brightness; + + target = temp.grg; + target2 = temp.bbr; + + temp = source - target; + temp += temp2; + temp2 = temp - target2; + + color = mix(source, temp2, Technicolor2_Strength); + + color = mix(vec3(dot(color, vec3(0.333))), color, Technicolor2_Saturation); + + return color; +} + +//Technicolor +vec3 TechnicolorPass(vec3 color) +{ + + const vec3 cyanfilter = vec3(0.0, 1.30, 1.0); + const vec3 magentafilter = vec3(1.0, 0.0, 1.05); + const vec3 yellowfilter = vec3(1.6, 1.6, 0.05); + const vec2 redorangefilter = vec2(1.05, 0.620); // RG_ + const vec2 greenfilter = vec2(0.30, 1.0); // RG_ + const vec2 magentafilter2 = magentafilter.rb; // R_B + + vec3 tcol = color.rgb; + + vec2 negative_mul_r = tcol.rg * (1.0 / (RGBNegativeAmount.r * Power)); + vec2 negative_mul_g = tcol.rg * (1.0 / (RGBNegativeAmount.g * Power)); + vec2 negative_mul_b = tcol.rb * (1.0 / (RGBNegativeAmount.b * Power)); + vec3 output_r = dot(redorangefilter, negative_mul_r).xxx + cyanfilter; + vec3 output_g = dot(greenfilter, negative_mul_g).xxx + magentafilter; + vec3 output_b = dot(magentafilter2, negative_mul_b).xxx + yellowfilter; + + return mix(tcol, output_r * output_g * output_b, Strength); +} + +//ColorMatrix +vec3 ColorMatrixPass(vec3 inputColor) +{ + vec3 color = inputColor; + + const mat3 ColorMatrix = mat3(ColorMatrix_Red, ColorMatrix_Green, ColorMatrix_Blue); + //color = mix(color, * (ColorMatrix, color), CM_Strength); + color *= mix(color, (ColorMatrix, color), CM_Strength); + return clamp(color, 0.0, 1.); +} + +// Contrasty + +vec3 BotWVibrance(vec3 color) { + float avg = (color.r + color.g + color.b) / 3.0; + float maxc = max(color.r, max(color.g, color.b)); + float w = 1.0 - pow(1.0 - 2.0 * avg, 2.0); + float weight = 1.0 + w * satFactor; + vec3 satcolor = mix(vec3(maxc), color, weight); + return satcolor; +} + +vec3 ReshadeVibrance(vec3 color) { + float max_color = max(color.r, max(color.g, color.b)); // Find the strongest color + float min_color = min(color.r, min(color.g, color.b)); // Find the weakest color + float luma = getL709(color); + float color_saturation = max_color - min_color; // The difference between the two is the saturation + vec3 coeffVibrance = VibranceRGBBalance * Vibrance; + color = mix(vec3(luma), color, 1.0 + (coeffVibrance * (1.0 - (sign(coeffVibrance) * color_saturation)))); + return color; +} + +vec3 Contrasty(vec3 fColour) { + fColour = max(vec3(0.0), fColour - vec3(crushContrast)); + fColour = clamp(Exposure * fColour, 0.0, 1.0); + fColour = pow(fColour, vec3(1.0 / Gamma)); + fColour = ReshadeVibrance(fColour); // reshade's identical, only a little stronger when at same setting + return fColour; +} + +// Levels + +vec3 LevelsPass(vec3 inputColor) { + float black_point_float = BlackPoint / 255.0; + float white_point_float = WhitePoint == BlackPoint ? (255.0 / 0.00025) : (255.0 / (WhitePoint - BlackPoint)); // Avoid division by zero if the white and black point are the same + + vec3 color = inputColor; + color = color * white_point_float - (black_point_float * white_point_float); + + return color; +} + +//FilmPass +vec3 FilmPass(vec3 inputColor) { + + vec3 B = inputColor.rgb; + vec3 G = B; + vec3 H = vec3(0.01); + + B = clamp(B, 0.0, 1.); + B = pow(vec3(B), vec3(Linearization)); + B = mix(H, B, Filmic_Contrast); + + vec3 LumCoeff = vec3(0.2126, 0.7152, 0.0722); + float A = dot(B.rgb, LumCoeff); + vec3 D = vec3(A); + + B = pow(B, 1.0 / vec3(BaseGamma)); + + float RedCurve = 1.0; + float GreenCurve = 1.0; + float BlueCurve = 1.0; + float a = RedCurve; + float b = GreenCurve; + float c = BlueCurve; + float d = BaseCurve; + + float y = 1.0 / (1.0 + exp(a / 2.0)); + float z = 1.0 / (1.0 + exp(b / 2.0)); + float w = 1.0 / (1.0 + exp(c / 2.0)); + float v = 1.0 / (1.0 + exp(d / 2.0)); + + vec3 C = B; + + D.r = (1.0 / (1.0 + exp(-a * (D.r - 0.5))) - y) / (1.0 - 2.0 * y); + D.g = (1.0 / (1.0 + exp(-b * (D.g - 0.5))) - z) / (1.0 - 2.0 * z); + D.b = (1.0 / (1.0 + exp(-c * (D.b - 0.5))) - w) / (1.0 - 2.0 * w); + + D = pow(D, 1.0 / vec3(EffectGamma)); + + vec3 Di = 1.0 - D; + + D = mix(D, Di, Filmic_Bleach); + float EffectGammaR = 1.0; + float EffectGammaG = 1.0; + float EffectGammaB = 1.0; + D.r = pow(abs(D.r), 1.0 / EffectGammaR); + D.g = pow(abs(D.g), 1.0 / EffectGammaG); + D.b = pow(abs(D.b), 1.0 / EffectGammaB); + + if (D.r < 0.5) + C.r = (2.0 * D.r - 1.0) * (B.r - B.r * B.r) + B.r; + else + C.r = (2.0 * D.r - 1.0) * (sqrt(B.r) - B.r) + B.r; + + if (D.g < 0.5) + C.g = (2.0 * D.g - 1.0) * (B.g - B.g * B.g) + B.g; + else + C.g = (2.0 * D.g - 1.0) * (sqrt(B.g) - B.g) + B.g; + + if (D.b < 0.5) + C.b = (2.0 * D.b - 1.0) * (B.b - B.b * B.b) + B.b; + else + C.b = (2.0 * D.b - 1.0) * (sqrt(B.b) - B.b) + B.b; + + vec3 F = mix(B, C, Filmic_Strength); + + F = (1.0 / (1.0 + exp(-d * (F - 0.5))) - v) / (1.0 - 2.0 * v); + + float r2R = 1.0 - Saturation; + float g2R = 0.0 + Saturation; + float b2R = 0.0 + Saturation; + + float r2G = 0.0 + Saturation; + float g2G = (1.0 - Fade) - Saturation; + float b2G = (0.0 + Fade) + Saturation; + + float r2B = 0.0 + Saturation; + float g2B = (0.0 + Fade) + Saturation; + float b2B = (1.0 - Fade) - Saturation; + + vec3 iF = F; + + F.r = (iF.r * r2R + iF.g * g2R + iF.b * b2R); + F.g = (iF.r * r2G + iF.g * g2G + iF.b * b2G); + F.b = (iF.r * r2B + iF.g * g2B + iF.b * b2B); + + float N = dot(F.rgb, LumCoeff); + vec3 Cn = F; + + if (N < 0.5) + Cn = (2.0 * N - 1.0) * (F - F * F) + F; + else + Cn = (2.0 * N - 1.0) * (sqrt(F) - F) + F; + + Cn = pow(max(Cn, 0), 1.0 / vec3(Linearization)); + + vec3 Fn = mix(B, Cn, Filmic_Strength); + return Fn; +} + +//DPX +const mat3 RGB = mat3( + 2.6714711726599600, -1.2672360578624100, -0.4109956021722270, + -1.0251070293466400, 1.9840911624108900, 0.0439502493584124, + 0.0610009456429445, -0.2236707508128630, 1.1590210416706100 +); +const mat3 XYZ = mat3( + 0.5003033835433160, 0.3380975732227390, 0.1645897795458570, + 0.2579688942747580, 0.6761952591447060, 0.0658358459823868, + 0.0234517888692628, 0.1126992737203000, 0.8668396731242010 +); +vec3 DPXPass(vec3 inputColor) +{ + vec3 color = inputColor; + + vec3 B = color; + B = B * (1.0 - DPX_Contrast) + (0.5 * DPX_Contrast); + vec3 Btemp = (1.0 / (1.0 + exp(RGB_Curve / 2.0))); + B = ((1.0 / (1.0 + exp(-RGB_Curve * (B - RGB_C)))) / (-2.0 * Btemp + 1.0)) + (-Btemp / (-2.0 * Btemp + 1.0)); + + float value = max(max(B.r, B.g), B.b); + vec3 Ztemp = B / value; + color = pow(abs(color), 1. / vec3(Colorfulness)); + + vec3 c0 = Ztemp * value; + c0 *= (XYZ, c0); + float luma = dot(c0, vec3(0.30, 0.59, 0.11)); + c0 = (1.0 - DPX_Saturation) * luma + DPX_Saturation * c0; + c0 *= (RGB, c0); + + return mix(color, c0, DPX_Strength); +} + +//Lift Gamma Gain + +vec3 LiftGammaGainPass(vec3 colorInput) +{ + // -- Get input -- + vec3 color = colorInput; + + // -- Lift -- + + color = color * (1.5 - 0.5 * RGB_Lift) + 0.5 * RGB_Lift - 0.5; + color = clamp(color, 0.0, 1.0); //isn't strictly necessary, but doesn't cost performance. + + // -- Gain -- + color *= RGB_Gain; + + // -- Gamma -- + color = pow(color, 1.0 / RGB_Gamma); //Gamma + + // -- Return output -- + return clamp(color, 0.0, 1.0); +} + +//VibrancePass +vec3 VibrancePass(vec3 color) { + + const vec3 coefLuma = vec3(0.2126, 0.7152, 0.0722); + float luma = dot(coefLuma, color); + + float max_color = max(color.r, max(color.g, color.b)); // Find the strongest color + float min_color = min(color.r, min(color.g, color.b)); // Find the weakest color + + float color_saturation = max_color - min_color; // The difference between the two is the saturation + + // Extrapolate between luma and original by 1 + (1-saturation) - current + vec3 coeffVibrance = VibranceRGBBalance * Vibrance; + + color = mix(vec3(luma), color, 1.0 + (coeffVibrance * (1.0 - (sign(coeffVibrance) * color_saturation)))); + + return color; +} + +//LumaShapening + +#define px (1.0/1280.0*uf_fragCoordScale.x) +#define py (1.0/720.0*uf_fragCoordScale.y) +#define CoefLuma vec3(0.2126, 0.7152, 0.0722) + +float lumasharping(sampler2D tex, vec2 pos) { + vec4 colorInput = texture(tex, pos); + + vec3 ori = colorInput.rgb; + + // -- Combining the strength and luma multipliers -- + vec3 sharp_strength_luma = (CoefLuma * sharp_strength); + + // -- Gaussian filter -- + // [ .25, .50, .25] [ 1 , 2 , 1 ] + // [ .50, 1, .50] = [ 2 , 4 , 2 ] + // [ .25, .50, .25] [ 1 , 2 , 1 ] + + vec3 blur_ori = texture(tex, pos + vec2(px, -py) * 0.5 * offset_bias).rgb; // South East + blur_ori += texture(tex, pos + vec2(-px, -py) * 0.5 * offset_bias).rgb; // South West + blur_ori += texture(tex, pos + vec2(px, py) * 0.5 * offset_bias).rgb; // North East + blur_ori += texture(tex, pos + vec2(-px, py) * 0.5 * offset_bias).rgb; // North West + + blur_ori *= 0.25; // ( /= 4) Divide by the number of texture fetches + + // -- Calculate the sharpening -- + vec3 sharp = ori - blur_ori; //Subtracting the blurred image from the original image + + // -- Adjust strength of the sharpening and clamp it-- + vec4 sharp_strength_luma_clamp = vec4(sharp_strength_luma * (0.5 / sharp_clamp), 0.5); //Roll part of the clamp into the dot + + float sharp_luma = clamp((dot(vec4(sharp, 1.0), sharp_strength_luma_clamp)), 0.0, 1.0); //Calculate the luma, adjust the strength, scale up and clamp + sharp_luma = (sharp_clamp * 2.0) * sharp_luma - sharp_clamp; //scale down + + return sharp_luma; +} + +//Fake High Dynamic Range. + +vec3 HDRPass(sampler2D tex, vec2 pos) { + vec3 color = texture(tex, pos).rgb; + + vec3 bloom_sum1 = texture(tex, pos + vec2(1.5, -1.5) * radius1 * vec2(px, py)).rgb; + bloom_sum1 += texture(tex, pos + vec2(-1.5, -1.5) * radius1 * vec2(px, py)).rgb; + bloom_sum1 += texture(tex, pos + vec2(1.5, 1.5) * radius1 * vec2(px, py)).rgb; + bloom_sum1 += texture(tex, pos + vec2(-1.5, 1.5) * radius1 * vec2(px, py)).rgb; + bloom_sum1 += texture(tex, pos + vec2(0.0, -2.5) * radius1 * vec2(px, py)).rgb; + bloom_sum1 += texture(tex, pos + vec2(0.0, 2.5) * radius1 * vec2(px, py)).rgb; + bloom_sum1 += texture(tex, pos + vec2(-2.5, 0.0) * radius1 * vec2(px, py)).rgb; + bloom_sum1 += texture(tex, pos + vec2(2.5, 0.0) * radius1 * vec2(px, py)).rgb; + + bloom_sum1 *= 0.005; + + vec3 bloom_sum2 = texture(tex, pos + vec2(1.5, -1.5) * radius2 * vec2(px, py)).rgb; + bloom_sum2 += texture(tex, pos + vec2(-1.5, -1.5) * radius2 * vec2(px, py)).rgb; + bloom_sum2 += texture(tex, pos + vec2(1.5, 1.5) * radius2 * vec2(px, py)).rgb; + bloom_sum2 += texture(tex, pos + vec2(-1.5, 1.5) * radius2 * vec2(px, py)).rgb; + bloom_sum2 += texture(tex, pos + vec2(0.0, -2.5) * radius2 * vec2(px, py)).rgb; + bloom_sum2 += texture(tex, pos + vec2(0.0, 2.5) * radius2 * vec2(px, py)).rgb; + bloom_sum2 += texture(tex, pos + vec2(-2.5, 0.0) * radius2 * vec2(px, py)).rgb; + bloom_sum2 += texture(tex, pos + vec2(2.5, 0.0) * radius2 * vec2(px, py)).rgb; + + bloom_sum2 *= 0.010; + + float dist = radius2 - radius1; + vec3 HDR = (color + (bloom_sum2 - bloom_sum1)) * dist; + + vec3 blend = HDR + color; + color = pow(abs(blend), vec3(abs(HDRPower))) + HDR; + + return color; +} + +void main() +{ + //Bloom + vec3 bloom = texture(textureUnitPS0, passParameterSem1.xy).xyz; +#if (adjust_bloom == 1) + bloom *= bloomFactor; +#endif + + //HDR and LumaShapening +#if (HDRpassing == 1) + passPixelColor0.xyz = HDRPass(textureUnitPS1, passParameterSem1.xy).xyz; +#endif +#if (HDRpassing == 0) + passPixelColor0.xyz = texture(textureUnitPS1, passParameterSem1.xy).xyz; +#endif +#if (lumapassing == 1) + float smask = lumasharping(textureUnitPS1, passParameterSem1.xy); + passPixelColor0.xyz += vec3(smask); +#endif + + // Do not edit this + vec3 color = (passPixelColor0.xyz); + color += bloom; + //++++++++++++++++++++++++++++++++++ + + // Tonemapping +#if (Tone_map == -1) + color = clamp(color*Exposure, 0.0, 1.0); +#elif (Tone_map == 0) + color = BotWToneMap(color); +#elif (Tone_map == 1) + color = ReshadeToneMap(color); +#elif (Tone_map == 2) + color = linearToneMapping(color); +#elif (Tone_map == 3) + color = simpleReinhardToneMapping(color); +#elif (Tone_map == 4) + color = lumaBasedReinhardToneMapping(color); +#elif (Tone_map == 5) + color = whitePreservingLumaBasedReinhardToneMapping(color); +#elif (Tone_map == 6) + color = RomBinDaHouseToneMapping(color); +#elif (Tone_map == 7) + color = filmicToneMapping(color); +#elif (Tone_map == 8) + color = Uncharted2ToneMapping(color); +#elif (tone_mapping == 9) + color = ACESFilm(color); +#endif + + // Levels Control if we tone map to 16-235 , 0 - 255 or usr defined range. +#if (blacknwhitepass == 1) + color = LevelsPass(color); +#endif + + // Color matrix +#if (cmatrix == 1) + color = ColorMatrixPass(color); +#endif + + + // Post Processing +#if (Tech == 1) + color = TechnicolorPass(color); +#endif +#if (Techine == 1) + color = Technicolor2(color); +#endif +#if (post_process == 0) + color = BotWVibrance(color); +#endif +#if (post_process == 1) + color = Contrasty(color); +#endif +#if (dpxpass == 1) + color = DPXPass(color); +#endif +#if (Filmicpass == 1) + color = FilmPass(color); +#endif +#if (lggpass == 1) + color = LiftGammaGainPass(color); +#endif +#if (CurvesPss == 1) + color = CurvesPass(color); +#endif +#if (vibpass == 1) + color = VibrancePass(color); +#endif + passPixelColor0 = vec4(color, passParameterSem1.w); +} +//########################################################## +// Possible problems +// Being below 1.3.3 will give you double-vision with recent graphic packs. Update to 1.3.0 or above. +// If you're experiencing any issues (due to having the previous Clarity shaders installed), please remove and redownload all of the BotW packs. +// Clarity GFX +// Credit to Jamie for main coding. +// Credit to Kiri coding & Reshade logic. +// Credit to Crementif for Help. +// Credit to Serfrost for preset values. +// Shader dumped from Cemu 1.11.2 from BotW 1.4.0 +// v 2.2 Final +// Add 1.4.0 support \ No newline at end of file