cemu_graphic_packs/Enthusiast/BreathOfTheWild_4320p/f0a615c0f6a37661_0000000000000079_ps.txt
alexkiri bd4f6cc09e [BOTW] Shrine reflections blur fix (#99)
* Added resolution independent FXAA for BotW

* Renamed to give FXAA priority over base graphics packs

* Updated FXAA implementation. Integrated Contrasty.

* Moved some defines to make more readable/editable

* Sharper detail settings, to make it look better at native res.

* Native AntiAliasing Restoration.

* Antialiasing restoration, removed unnecessary files.

* Edited Contrasty to be disabled by default

* [BotW] Fixed upscaled blur pixelation for reflections on shrine walls
2017-10-08 14:30:25 +02:00

44 lines
2.1 KiB
Plaintext

#version 420
#extension GL_ARB_texture_gather : enable
// shader f0a615c0f6a37661 // vertical blur 4320 for reflections on shrine walls, floors and probably other
uniform ivec4 uf_remappedPS[1];
layout(binding = 0) uniform sampler2D textureUnitPS0;// Tex0 addr 0xf51d3000 res 320x180x1 dim 1 tm: 4 format 001a compSel: 0 1 2 3 mipView: 0x0 (num 0x1) sliceView: 0x0 (num 0x1) Sampler0 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;
float data = passParameterSem0.z - passParameterSem0.w;
float h = data / 1.38461538 * uf_fragCoordScale.y;
uniform float o_weight[] = float[]( 0.29411765, 0.35294118 );
uniform float o_offset[] = float[]( 0.00000000, 1.33333333 );
uniform float weight[] = float[]( 0.08679764, 0.16377778, 0.12975631, 0.08523885, 0.04634210, 0.02079453, 0.00767262, 0.00231673, 0.00056902, 0.00011284, 0.00001790, 0.00000225, 0.00000022, 0.00000002 );
uniform float offset[] = float[]( 0.00000000, 1.48235294, 3.45882353, 5.43529412, 7.41176471, 9.38823529, 11.36470588, 13.34117647, 15.31764706, 17.29411765, 19.27058824, 21.24705882, 23.22352941, 25.20000000 );
float mul_nonIEEE(float a, float b){ if( a == 0.0 || b == 0.0 ) return 0.0; return a*b; }
void main()
{
vec2 R0f = vec2(passParameterSem0.x, passParameterSem0.w);
vec4 R1f = texture( textureUnitPS0, R0f ) * weight[0];
for (int i=1; i<14; i++) {
R1f += texture( textureUnitPS0, R0f + vec2(0.0, offset[i]*h) ) * weight[i];
R1f += texture( textureUnitPS0, R0f - vec2(0.0, offset[i]*h) ) * weight[i];
}
vec4 R2f = texture( textureUnitPS0, R0f ) * o_weight[0];
for (int i=1; i<2; i++) {
R2f += texture( textureUnitPS0, R0f + vec2(0.0, o_offset[i]*h) ) * o_weight[i];
R2f += texture( textureUnitPS0, R0f - vec2(0.0, o_offset[i]*h) ) * o_weight[i];
}
passPixelColor0 = ( (uf_fragCoordScale.y == 1.0) ? R2f : R1f );
//alpha boost and clamp, according to original shader
passPixelColor0.w = mul_nonIEEE(intBitsToFloat(uf_remappedPS[0].x), passPixelColor0.w);
passPixelColor0.w = clamp(passPixelColor0.w, 0.0, 1.0);
}