Clarity GFX

Added HDR + lumashapening to the same Shader, Everything now should work as intended, Thank you Navras for helping means alot.
This commit is contained in:
Jamie 2017-11-04 02:44:51 -07:00
parent a2630204fc
commit 135226e205
5 changed files with 162 additions and 583 deletions

View File

@ -1,10 +0,0 @@
There is currently 3 releases of Clarity in this pack,
The default is with No lumasharpening or HDR.
The second titled.lumasharpening is the same file as above but with lumashapening.
The third FakeHDR is the same but with Faked HDR
You cannot Enable all 3 packs at once , so you need to rename the file by removing the ending extention .lumasharpening or FakeHDR .
The Origional File I would back upto its name.txt.origional case you want to revert for any reason.
Please Note sword effect's are slightly off in Faked HDR .. Looking for a solution.
lumasharpening and FakeHDR were Brought over from SweetFX, Reshade to be used as a 1- pass shader .. They cannot be enabled or used at the same time..

View File

@ -10,7 +10,8 @@
// Changelog V0.1
// Changed from shader f14bb_ps.txt to bd8bb_ps.txt
// Credit to NAVras for merging to a better shader.
// Credit to NAVras for merging to a better shader.(specal Note Thank you NAVras, For Helping Debug and answering silly questions.)
// Could not have got this far without you.
// Credit to getdls for adding exposure & Original Contrasty.
// Clarity GFX
@ -19,21 +20,34 @@
// Credit to Serfrost for preset values.
// Original shader dumped using cemu 1.10.0f, BotW 1.3.1
// Changelog v0.5
// Changelog v0.7
//##########################################################
// Contrast, saturation, Gamma , Vibrance , Defog.
//ToneMapping
const float bloomFactor = 0.0; //Default is 1.0
const float gamma = 1.00; //Default is 1.0
const float Bleach = 0.2; //Default is 0.0
const float vibrance = 0.015; // 0.0 is neutral
//Adjustable Values:
const float con = 0.80; // [0.0 ~ 1.5] [0.5 Default] Contrast Adjustment - or + values work
const float sat = 0.00; // [0.1 ~ 1.5] [0.0 Default] Color Saturation Adjustment. - or + values work
const float gamma = 1.43; // [0.0 ~ 2.5] [1.0 Default] Gamma Adjustment - or + values work
//Luma Values for changing color. Machinima tool mostly.
const float AvgLumR = 0.0; // [0.0 ~ 1.5] [0.0 Default] Use very small increments, as it changes RGB values.
const float AvgLumG = -0.003; // [0.0 ~ 1.5] [0.0 Default] Use very small increments, as it changes RGB values.
const float AvgLumB = 0.0; // [0.0 ~ 1.5] [0.0 Default] Use very small increments, as it changes RGB values.
//LumaShapening
#define sharp_strength 0.25 //[0.10 to 3.00] Strength of the sharpening Default is 0.65
#define sharp_clamp 0.085 //[0.000 to 1.000] Limits maximum amount of sharpening a pixel recieves - Default is 0.035
//Advanced sharpening settings
#define offset_bias 1.0 //[0.0 to 6.0] Offset bias adjusts the radius of the sampling pattern.
//Technicolor2
#define Technicolor2_Red_Strength 0.0 //Default is 0.0
#define Technicolor2_Green_Strength 0.0 //Default is 0.0
#define Technicolor2_Blue_Strength 0.0 //Default is 0.0
#define Technicolor2_Brightness 1.0 //Default is 1.0
#define Technicolor2_Strength 0.40 //Default is 1.0
#define Technicolor2_Saturation 0.51 //Default is 1.0
//Fake High Dynamic Range.
#define HDRPower 1.20 // 0.0 to 8.0 "Raising this seems to make the effect stronger and also brighter , Default 1.30."
#define radius1 0.50 // 0.0 to 8.0 "Default 0.793 , will affect FX."
#define radius2 0.50 // 0.0 to 8.0 "Default 0.87 , will affect FX."
//-----------------------------------------------------------
//End of adjustable values
@ -41,11 +55,8 @@ const float AvgLumB = 0.0; // [0.0 ~ 1.5] [0.0 Default] Use very small incr
//###########################################################
//Do not edit under this line.
const float exposure = 0.00;
const float Bleach = 0.0;
const float brt = 0.0;
const vec3 FogColor = vec3(0.0, 0.0, 0.0); //defog Color";
const float sat = 0.0;
uniform ivec4 uf_remappedPS[1];
layout(binding = 0) uniform sampler2D textureUnitPS0;// Tex0 addr 0xf46ac800 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
@ -63,16 +74,19 @@ 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; }
//-----------------------------------------------------------
// Based on CeeJay.dk's original GLSL/HLSL.
//-----------------------------------------------------------
float exposure(vec3 eye, vec3 L, float low, float high) {
return mix(
low,
high,
pow((1.0 - dot(normalize(eye), L)) / 2.0, 10.0)
);
}
//ToneMapping
vec3 TonemapPass(vec3 inputColor) {
vec3 color = inputColor;
//color = clamp(color - defog * FogColor * 2.55, 0.0, 1.0); // defog
color *= pow(2.0f, exposure); // exposure
color = pow(color, vec3(gamma)); // Gamma
const vec3 coefLuma = vec3(0.2126, 0.7152, 0.0722);
float lum = dot(coefLuma, color);
@ -93,8 +107,116 @@ vec3 TonemapPass(vec3 inputColor) {
return color;
}
vec3 brightnessContrast(vec3 color, float brt, float con){
return (color - 0.5) * con + 0.5 + brt;
//TECHNICOLOR2
vec3 Technicolor2(vec3 inputColor) {
vec3 color = inputColor;
vec3 Color_Strength = vec3(Technicolor2_Red_Strength, Technicolor2_Green_Strength, Technicolor2_Blue_Strength);
vec3 source = clamp(color, 0.0, 1.0);
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 clamp (color, 0.0, 1.0);
}
//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 ]
//float px = 1.0/tex_size[0];
//float py = 1.0/tex_size[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
// -- Combining the values to get the final sharpened pixel --
//colorInput.rgb = colorInput.rgb + sharp_luma; // Add the sharpening to the input color.
return sharp_luma;
}
//Fake High Dynamic Range.
vec3 HDRPass(sampler2D tex, vec2 pos){
vec4 colorInput = texture(tex, pos);
vec3 color = colorInput.rgb;
vec3 bloom_sum1 = texture(tex, pos + vec2(1.5, -1.5) * radius1).rgb;
bloom_sum1 += texture(tex, pos + vec2(-1.5, -1.5) * radius1).rgb;
bloom_sum1 += texture(tex, pos + vec2( 1.5, 1.5) * radius1).rgb;
bloom_sum1 += texture(tex, pos + vec2(-1.5, 1.5) * radius1).rgb;
bloom_sum1 += texture(tex, pos + vec2( 0.0, -2.5) * radius1).rgb;
bloom_sum1 += texture(tex, pos + vec2( 0.0, 2.5) * radius1).rgb;
bloom_sum1 += texture(tex, pos + vec2(-2.5, 0.0) * radius1).rgb;
bloom_sum1 += texture(tex, pos + vec2( 2.5, 0.0) * radius1).rgb;
bloom_sum1 *= 0.005;
vec3 bloom_sum2 = texture(tex, pos + vec2(1.5, -1.5) * radius2).rgb;
bloom_sum2 += texture(tex, pos + vec2(-1.5, -1.5) * radius2).rgb;
bloom_sum2 += texture(tex, pos + vec2( 1.5, 1.5) * radius2).rgb;
bloom_sum2 += texture(tex, pos + vec2(-1.5, 1.5) * radius2).rgb;
bloom_sum2 += texture(tex, pos + vec2( 0.0, -2.5) * radius2).rgb;
bloom_sum2 += texture(tex, pos + vec2( 0.0, 2.5) * radius2).rgb;
bloom_sum2 += texture(tex, pos + vec2(-2.5, 0.0) * radius2).rgb;
bloom_sum2 += texture(tex, pos + vec2( 2.5, 0.0) * radius2).rgb;
bloom_sum2 *= 0.010;
float dist = radius1 - radius2;
vec3 HDR = (colorInput.rgb + (bloom_sum2 - bloom_sum1)) * dist;
vec3 blend = HDR + colorInput.rgb;
colorInput.rgb = pow(abs(blend), vec3(abs(HDRPower)) + HDR);
return clamp(colorInput.rgb, 0.0,1.0);
}
void main()
@ -117,7 +239,10 @@ vec3 cubeMapSTM;
int cubeMapFaceId;
R0f = passParameterSem0;
R1f.xyz = (texture(textureUnitPS0, R0f.xy).xyz);
R0f.xyz = (texture(textureUnitPS1, R0f.xy).xyz);
R1f.xyz *= bloomFactor;
R0f.xyz = HDRPass(textureUnitPS1, passParameterSem0.xy);
float smask = lumasharping(textureUnitPS1, passParameterSem0.xy);
R0f.xyz += vec3(smask);
// 0
R126f.x = R1f.x + R0f.x;
PV0f.x = R126f.x;
@ -213,12 +338,14 @@ R0f.z = (mul_nonIEEE(R126f.x,R126f.y) + PV1f.w);
passPixelColor0 = vec4(R0f.x, R0f.y, R0f.z, R0f.w);
vec3 color = (passPixelColor0.xyz);
float luminance = color.r*intBitsToFloat(0x3e99096c) + color.g*intBitsToFloat(0x3f162b6b) + color.b*intBitsToFloat(0x3dea4a8c);
float mn = min(min(color.r, color.g), color.b);
float mx = max(max(color.r, color.g), color.b);
float sat = (1.0-(mx - mn)) * (1.0-mx) * luminance * 5.0;
vec3 lightness = vec3((mn + mx)/2.0);
color = TonemapPass(color);
const vec3 LumCoeff = vec3(0.2125, 0.7154, 0.0721);
vec3 AvgLumin = vec3(AvgLumR, AvgLumG, AvgLumB);
vec3 brtColor = color * brt;
vec3 intensity = vec3(dot(color, LumCoeff));
vec3 satColor = mix(intensity, color, 1.);
vec3 conColor = mix(AvgLumin, satColor, con);
passPixelColor0 = vec4(conColor, R0f.w);
color = Technicolor2(color);
color = pow(color, vec3(1.0 / gamma));
color = mix(color, mix(color, lightness, -vibrance), sat);
passPixelColor0 = vec4(color, R0f.w);
}

View File

@ -1,265 +0,0 @@
#version 420
#extension GL_ARB_texture_gather : enable
// shader bd8bba59e2149449
// Possible problems
// Being below 1.3.0 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.
// Changelog V0.1
// Changed from shader f14bb_ps.txt to bd8bb_ps.txt
// Credit to NAVras for merging to a better shader.
// Credit to getdls for adding exposure & Original Contrasty.
// Clarity GFX
// Credit to Jamie for main coding.
// Credit to Kiri coding & Reshade logic.
// Credit to Serfrost for preset values.
// Original shader dumped using cemu 1.10.0f, BotW 1.3.1
// Changelog v0.5
//##########################################################
// Contrast, saturation, Gamma.
//Adjustable Values:
const float gamma = 1.00; // [0.0 ~ 2.5] [1.0 Default] Gamma Adjustment - or + values work
const float bloomFactor = 0.7; // 1.0 is neutral
const float brt = 1.0;
const float con = 0.75;
const float sat = 0.0;
//Luma Values for changing color. Machinima tool mostly.
const float AvgLumR = 0.0; // [0.0 ~ 1.5] [0.0 Default] Use very small increments, as it changes RGB values.
const float AvgLumG = -0.003; // [0.0 ~ 1.5] [0.0 Default] Use very small increments, as it changes RGB values.
const float AvgLumB = 0.0; // [0.0 ~ 1.5] [0.0 Default] Use very small increments, as it changes RGB values.
//-----------------------------------------------------------
//End of adjustable values
//###########################################################
//Do not edit under this line.
const float exposure = 0.00;
const float Bleach = 0.0;
const vec3 FogColor = vec3(0.0, 0.0, 0.0); //defog Color";
uniform ivec4 uf_remappedPS[1];
layout(binding = 0) uniform sampler2D textureUnitPS0;// Tex0 addr 0xf46ac800 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 sampler2D textureUnitPS1;// Tex1 addr 0xf5c7b800 res 1280x720x1 dim 1 tm: 4 format 0816 compSel: 0 1 2 5 mipView: 0x0 (num 0x1) sliceView: 0x0 (num 0x1) Sampler1 ClampX/Y/Z: 2 2 2 border: 1
layout(location = 0) in vec4 passParameterSem0;
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; }
//-----------------------------------------------------------
// Based on CeeJay.dk's original GLSL/HLSL.
//-----------------------------------------------------------
vec3 TonemapPass(vec3 inputColor) {
vec3 color = inputColor;
color *= pow(2.0f, exposure); // exposure
color = pow(color, vec3(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;
}
vec3 brightnessContrast(vec3 color, float brt, float con){
return (color - 0.5) * con + 0.5 + brt;
}
//Fake High Dynamic Range.
#define HDRPower 1.30 // 0.0 to 8.0 "Raising this seems to make the effect stronger and also brighter."
#define radius1 0.793 // 0.0 to 8.0 "Raising this seems to make the effect stronger and also brighter."
#define radius2 0.87 // 0.0 to 8.0 "Raising this seems to make the effect stronger and also brighter."
vec3 HDRPass(sampler2D tex, vec2 pos){
vec4 colorInput = texture(tex, pos);
vec3 color = colorInput.rgb;
vec3 bloom_sum1 = texture(tex, pos + vec2(1.5, -1.5) * radius1).rgb;
bloom_sum1 += texture(tex, pos + vec2(-1.5, -1.5) * radius1).rgb;
bloom_sum1 += texture(tex, pos + vec2( 1.5, 1.5) * radius1).rgb;
bloom_sum1 += texture(tex, pos + vec2(-1.5, 1.5) * radius1).rgb;
bloom_sum1 += texture(tex, pos + vec2( 0.0, -2.5) * radius1).rgb;
bloom_sum1 += texture(tex, pos + vec2( 0.0, 2.5) * radius1).rgb;
bloom_sum1 += texture(tex, pos + vec2(-2.5, 0.0) * radius1).rgb;
bloom_sum1 += texture(tex, pos + vec2( 2.5, 0.0) * radius1).rgb;
bloom_sum1 *= 0.005;
vec3 bloom_sum2 = texture(tex, pos + vec2(1.5, -1.5) * radius2).rgb;
bloom_sum2 += texture(tex, pos + vec2(-1.5, -1.5) * radius2).rgb;
bloom_sum2 += texture(tex, pos + vec2( 1.5, 1.5) * radius2).rgb;
bloom_sum2 += texture(tex, pos + vec2(-1.5, 1.5) * radius2).rgb;
bloom_sum2 += texture(tex, pos + vec2( 0.0, -2.5) * radius2).rgb;
bloom_sum2 += texture(tex, pos + vec2( 0.0, 2.5) * radius2).rgb;
bloom_sum2 += texture(tex, pos + vec2(-2.5, 0.0) * radius2).rgb;
bloom_sum2 += texture(tex, pos + vec2( 2.5, 0.0) * radius2).rgb;
bloom_sum2 *= 0.010;
float dist = radius1 - radius2;
vec3 HDR = (colorInput.rgb + (bloom_sum2 - bloom_sum1)) * dist;
vec3 blend = HDR + colorInput.rgb;
colorInput.rgb = pow(abs(blend), vec3(abs(HDRPower)) + HDR);
return clamp(colorInput.rgb, 0.0,1.0);
}
void main()
{
vec4 R0f = vec4(0.0);
vec4 R1f = 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.xyz = (texture(textureUnitPS0, R0f.xy).xyz);
R1f.xyz *= bloomFactor;
R0f.xyz = HDRPass(textureUnitPS1, R0f.xy);
// 0
R126f.x = R1f.x + R0f.x;
PV0f.x = R126f.x;
R127f.y = R1f.y + R0f.y;
PV0f.y = R127f.y;
R126f.z = R1f.z + R0f.z;
PV0f.z = R126f.z;
R125f.w = 1.0;
// 1
tempf.x = dot(vec4(PV0f.x,PV0f.y,PV0f.z,-0.0),vec4(intBitsToFloat(0x3e99096c),intBitsToFloat(0x3f162b6b),intBitsToFloat(0x3dea4a8c),0.0));
PV1f.x = tempf.x;
PV1f.y = tempf.x;
PV1f.z = tempf.x;
PV1f.w = tempf.x;
// 2
R127f.x = -(R127f.y) * intBitsToFloat(0x3fb8aa3b);
PV0f.y = -(PV1f.x) * intBitsToFloat(0x3fb8aa3b);
R127f.z = -(R126f.x) * intBitsToFloat(0x3fb8aa3b);
R127f.w = -(R126f.z) * intBitsToFloat(0x3fb8aa3b);
R126f.w = 1.0 / PV1f.x;
PS0f = R126f.w;
// 3
PS1f = exp2(PV0f.y);
// 4
PV0f.x = -(PS1f) + 1.0;
PS0f = exp2(R127f.x);
// 5
R127f.x = -(PS0f) + 1.0;
R126f.y = mul_nonIEEE(PV0f.x, PV0f.x);
PV1f.z = PV0f.x * R126f.w;
PS1f = exp2(R127f.w);
// 6
backupReg0f = R126f.x;
backupReg1f = R127f.z;
R126f.x = mul_nonIEEE(backupReg0f, PV1f.z);
PV0f.y = -(PS1f) + 1.0;
R127f.z = mul_nonIEEE(R126f.z, PV1f.z);
PV0f.z = R127f.z;
R127f.w = mul_nonIEEE(R127f.y, PV1f.z);
PV0f.w = R127f.w;
PS0f = exp2(backupReg1f);
// 7
PV1f.x = R127f.x + -(PV0f.w);
PV1f.y = PV0f.y + -(PV0f.z);
PV1f.w = -(PS0f) + 1.0;
// 8
backupReg0f = R127f.z;
R127f.x = (mul_nonIEEE(PV1f.x,R126f.y) + R127f.w);
R127f.x = clamp(R127f.x, 0.0, 1.0);
PV0f.x = R127f.x;
PV0f.y = PV1f.w + -(R126f.x);
R127f.z = (mul_nonIEEE(PV1f.y,R126f.y) + backupReg0f);
R127f.z = clamp(R127f.z, 0.0, 1.0);
PV0f.z = R127f.z;
// 9
backupReg0f = R126f.x;
R126f.x = (mul_nonIEEE(PV0f.y,R126f.y) + backupReg0f);
R126f.x = clamp(R126f.x, 0.0, 1.0);
PV1f.x = R126f.x;
R126f.y = max(PV0f.x, PV0f.z);
PV1f.w = min(PV0f.x, PV0f.z);
// 10
tempf.x = dot(vec4(PV1f.x,R127f.x,R127f.z,R125f.w),vec4(intBitsToFloat(0x3f2aaaab),intBitsToFloat(0x3f2aaaab),intBitsToFloat(0x3f2aaaab),-(1.0)));
PV0f.x = tempf.x;
PV0f.y = tempf.x;
PV0f.z = tempf.x;
PV0f.w = tempf.x;
R126f.z = min(PV1f.x, PV1f.w);
PS0f = R126f.z;
// 11
backupReg0f = R127f.x;
backupReg1f = R127f.z;
R127f.x = max(R126f.x, R126f.y);
PV1f.x = R127f.x;
R123f.y = (mul_nonIEEE(-(PV0f.x),PV0f.x) + 1.0);
PV1f.y = R123f.y;
R127f.z = backupReg0f + -(PS0f);
R125f.w = R126f.x + -(PS0f);
R126f.y = backupReg1f + -(PS0f);
PS1f = R126f.y;
// 12
R126f.x = (mul_nonIEEE(PV1f.y,intBitsToFloat(uf_remappedPS[0].y)) + intBitsToFloat(uf_remappedPS[0].x));
PV0f.x = R126f.x;
PV0f.y = -(R126f.z) + PV1f.x;
// 13
R123f.w = (mul_nonIEEE(-(PV0f.x),PV0f.y) + R127f.x);
PV1f.w = R123f.w;
// 14
R0f.x = (mul_nonIEEE(R126f.x,R125f.w) + PV1f.w);
R0f.y = (mul_nonIEEE(R126f.x,R127f.z) + PV1f.w);
R0f.z = (mul_nonIEEE(R126f.x,R126f.y) + PV1f.w);
passPixelColor0 = vec4(R0f.x, R0f.y, R0f.z, R0f.w);
vec3 color = (passPixelColor0.xyz);
color = TonemapPass(color);
const vec3 LumCoeff = vec3(0.2125, 0.7154, 0.0721);
vec3 AvgLumin = vec3(AvgLumR, AvgLumG, AvgLumB);
vec3 brtColor = color * brt;
vec3 intensity = vec3(dot(color, LumCoeff));
vec3 satColor = mix(intensity, color, 1.);
vec3 conColor = mix(AvgLumin, satColor, con);
passPixelColor0 = vec4(conColor, R0f.w);
}

View File

@ -1,273 +0,0 @@
#version 420
#extension GL_ARB_texture_gather : enable
// shader bd8bba59e2149449
// Possible problems
// Being below 1.3.0 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.
// Changelog V0.1
// Changed from shader f14bb_ps.txt to bd8bb_ps.txt
// Credit to NAVras for merging to a better shader.
// Credit to getdls for adding exposure & Original Contrasty.
// Clarity GFX
// Credit to Jamie for main coding.
// Credit to Kiri coding & Reshade logic.
// Credit to Serfrost for preset values.
// Original shader dumped using cemu 1.10.0f, BotW 1.3.1
// Changelog v0.5
//##########################################################
// Contrast, saturation, Gamma.
//Adjustable Values:
const float con = 0.80; // [0.0 ~ 1.5] [0.5 Default] Contrast Adjustment - or + values work
const float sat = 0.00; // [0.1 ~ 1.5] [0.0 Default] Color Saturation Adjustment. - or + values work
const float gamma = 1.43; // [0.0 ~ 2.5] [1.0 Default] Gamma Adjustment - or + values work
//Luma Values for changing color. Machinima tool mostly.
const float AvgLumR = 0.0; // [0.0 ~ 1.5] [0.0 Default] Use very small increments, as it changes RGB values.
const float AvgLumG = -0.003; // [0.0 ~ 1.5] [0.0 Default] Use very small increments, as it changes RGB values.
const float AvgLumB = 0.0; // [0.0 ~ 1.5] [0.0 Default] Use very small increments, as it changes RGB values.
//-----------------------------------------------------------
//End of adjustable values
//###########################################################
//Do not edit under this line.
const float exposure = 0.00;
const float Bleach = 0.0;
uniform float brt;
const vec3 FogColor = vec3(0.0, 0.0, 0.0); //defog Color";
uniform ivec4 uf_remappedPS[1];
layout(binding = 0) uniform sampler2D textureUnitPS0;// Tex0 addr 0xf46ac800 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 sampler2D textureUnitPS1;// Tex1 addr 0xf5c7b800 res 1280x720x1 dim 1 tm: 4 format 0816 compSel: 0 1 2 5 mipView: 0x0 (num 0x1) sliceView: 0x0 (num 0x1) Sampler1 ClampX/Y/Z: 2 2 2 border: 1
layout(location = 0) in vec4 passParameterSem0;
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; }
//-----------------------------------------------------------
// Based on CeeJay.dk's original GLSL/HLSL.
//-----------------------------------------------------------
vec3 TonemapPass(vec3 inputColor) {
vec3 color = inputColor;
color *= pow(2.0f, exposure); // exposure
color = pow(color, vec3(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;
}
vec3 brightnessContrast(vec3 color, float brt, float con){
return (color - 0.5) * con + 0.5 + brt;
}
// -- Sharpening --
#define px (1.0/1280.0*uf_fragCoordScale.x)
#define py (1.0/720.0*uf_fragCoordScale.y)
#define sharp_strength 0.65 //[0.10 to 3.00] Strength of the sharpening
#define sharp_clamp 0.035 //[0.000 to 1.000] Limits maximum amount of sharpening a pixel recieves - Default is 0.035
// -- Advanced sharpening settings --
#define offset_bias 1.0 //[0.0 to 6.0] Offset bias adjusts the radius of the sampling pattern.
#define CoefLuma vec3(0.2126, 0.7152, 0.0722)
vec3 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 ]
//float px = 1.0/tex_size[0];
//float py = 1.0/tex_size[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
// -- Combining the values to get the final sharpened pixel --
colorInput.rgb = colorInput.rgb + sharp_luma; // Add the sharpening to the input color.
return clamp(colorInput.rgb, 0.0,1.0);
}
void main()
{
vec4 R0f = vec4(0.0);
vec4 R1f = 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.xyz = (texture(textureUnitPS0, R0f.xy).xyz);
R0f.xyz = lumasharping(textureUnitPS1, R0f.xy);
// 0
R126f.x = R1f.x + R0f.x;
PV0f.x = R126f.x;
R127f.y = R1f.y + R0f.y;
PV0f.y = R127f.y;
R126f.z = R1f.z + R0f.z;
PV0f.z = R126f.z;
R125f.w = 1.0;
// 1
tempf.x = dot(vec4(PV0f.x,PV0f.y,PV0f.z,-0.0),vec4(intBitsToFloat(0x3e99096c),intBitsToFloat(0x3f162b6b),intBitsToFloat(0x3dea4a8c),0.0));
PV1f.x = tempf.x;
PV1f.y = tempf.x;
PV1f.z = tempf.x;
PV1f.w = tempf.x;
// 2
R127f.x = -(R127f.y) * intBitsToFloat(0x3fb8aa3b);
PV0f.y = -(PV1f.x) * intBitsToFloat(0x3fb8aa3b);
R127f.z = -(R126f.x) * intBitsToFloat(0x3fb8aa3b);
R127f.w = -(R126f.z) * intBitsToFloat(0x3fb8aa3b);
R126f.w = 1.0 / PV1f.x;
PS0f = R126f.w;
// 3
PS1f = exp2(PV0f.y);
// 4
PV0f.x = -(PS1f) + 1.0;
PS0f = exp2(R127f.x);
// 5
R127f.x = -(PS0f) + 1.0;
R126f.y = mul_nonIEEE(PV0f.x, PV0f.x);
PV1f.z = PV0f.x * R126f.w;
PS1f = exp2(R127f.w);
// 6
backupReg0f = R126f.x;
backupReg1f = R127f.z;
R126f.x = mul_nonIEEE(backupReg0f, PV1f.z);
PV0f.y = -(PS1f) + 1.0;
R127f.z = mul_nonIEEE(R126f.z, PV1f.z);
PV0f.z = R127f.z;
R127f.w = mul_nonIEEE(R127f.y, PV1f.z);
PV0f.w = R127f.w;
PS0f = exp2(backupReg1f);
// 7
PV1f.x = R127f.x + -(PV0f.w);
PV1f.y = PV0f.y + -(PV0f.z);
PV1f.w = -(PS0f) + 1.0;
// 8
backupReg0f = R127f.z;
R127f.x = (mul_nonIEEE(PV1f.x,R126f.y) + R127f.w);
R127f.x = clamp(R127f.x, 0.0, 1.0);
PV0f.x = R127f.x;
PV0f.y = PV1f.w + -(R126f.x);
R127f.z = (mul_nonIEEE(PV1f.y,R126f.y) + backupReg0f);
R127f.z = clamp(R127f.z, 0.0, 1.0);
PV0f.z = R127f.z;
// 9
backupReg0f = R126f.x;
R126f.x = (mul_nonIEEE(PV0f.y,R126f.y) + backupReg0f);
R126f.x = clamp(R126f.x, 0.0, 1.0);
PV1f.x = R126f.x;
R126f.y = max(PV0f.x, PV0f.z);
PV1f.w = min(PV0f.x, PV0f.z);
// 10
tempf.x = dot(vec4(PV1f.x,R127f.x,R127f.z,R125f.w),vec4(intBitsToFloat(0x3f2aaaab),intBitsToFloat(0x3f2aaaab),intBitsToFloat(0x3f2aaaab),-(1.0)));
PV0f.x = tempf.x;
PV0f.y = tempf.x;
PV0f.z = tempf.x;
PV0f.w = tempf.x;
R126f.z = min(PV1f.x, PV1f.w);
PS0f = R126f.z;
// 11
backupReg0f = R127f.x;
backupReg1f = R127f.z;
R127f.x = max(R126f.x, R126f.y);
PV1f.x = R127f.x;
R123f.y = (mul_nonIEEE(-(PV0f.x),PV0f.x) + 1.0);
PV1f.y = R123f.y;
R127f.z = backupReg0f + -(PS0f);
R125f.w = R126f.x + -(PS0f);
R126f.y = backupReg1f + -(PS0f);
PS1f = R126f.y;
// 12
R126f.x = (mul_nonIEEE(PV1f.y,intBitsToFloat(uf_remappedPS[0].y)) + intBitsToFloat(uf_remappedPS[0].x));
PV0f.x = R126f.x;
PV0f.y = -(R126f.z) + PV1f.x;
// 13
R123f.w = (mul_nonIEEE(-(PV0f.x),PV0f.y) + R127f.x);
PV1f.w = R123f.w;
// 14
R0f.x = (mul_nonIEEE(R126f.x,R125f.w) + PV1f.w);
R0f.y = (mul_nonIEEE(R126f.x,R127f.z) + PV1f.w);
R0f.z = (mul_nonIEEE(R126f.x,R126f.y) + PV1f.w);
passPixelColor0 = vec4(R0f.x, R0f.y, R0f.z, R0f.w);
vec3 color = (passPixelColor0.xyz);
color = TonemapPass(color);
const vec3 LumCoeff = vec3(0.2125, 0.7154, 0.0721);
vec3 AvgLumin = vec3(AvgLumR, AvgLumG, AvgLumB);
vec3 brtColor = color * brt;
vec3 intensity = vec3(dot(color, LumCoeff));
vec3 satColor = mix(intensity, color, 1.);
vec3 conColor = mix(AvgLumin, satColor, con);
passPixelColor0 = vec4(conColor, R0f.w);
}

View File

@ -1,4 +1,4 @@
[Definition]
titleIds = 00050000101C9300,00050000101C9400,00050000101C9500
name = "The Legend of Zelda: Breath of the Wild - Clarity GFX"
name = "The Legend of Zelda: Breath of the Wild - Clarity GFX UHD"
version = 2