From 2c3d552cbf02bcc48a1f4d7e9d4b50eb2e713867 Mon Sep 17 00:00:00 2001 From: NAVras-Z Date: Sat, 30 Sep 2017 06:01:54 +0800 Subject: [PATCH] [BOTW] Add custom blur shaders (#86) * Fix some pixelated blur in high res * forgot to add rule * double offset to get similar blur more powah * move into every res pack (excepth res<= 720) credit to @JoelAlone for finding the what those values does. ps: why github changes file hash...? --- .../45d85f1d25e7d0de_0000000000000079_ps.txt | 36 ++++++++++ .../4dc5fdeced670c5e_0000000000000079_ps.txt | 36 ++++++++++ .../cb0e6e8cbec4502a_0000000000000079_ps.txt | 38 ++++++++++ .../45d85f1d25e7d0de_0000000000000079_ps.txt | 36 ++++++++++ .../4dc5fdeced670c5e_0000000000000079_ps.txt | 36 ++++++++++ .../cb0e6e8cbec4502a_0000000000000079_ps.txt | 38 ++++++++++ .../45d85f1d25e7d0de_0000000000000079_ps.txt | 36 ++++++++++ .../4dc5fdeced670c5e_0000000000000079_ps.txt | 36 ++++++++++ .../cb0e6e8cbec4502a_0000000000000079_ps.txt | 38 ++++++++++ .../45d85f1d25e7d0de_0000000000000079_ps.txt | 70 +++++-------------- .../4dc5fdeced670c5e_0000000000000079_ps.txt | 70 +++++-------------- .../cb0e6e8cbec4502a_0000000000000079_ps.txt | 38 ++++++++++ .../45d85f1d25e7d0de_0000000000000079_ps.txt | 70 +++++-------------- .../4dc5fdeced670c5e_0000000000000079_ps.txt | 70 +++++-------------- .../cb0e6e8cbec4502a_0000000000000079_ps.txt | 38 ++++++++++ .../45d85f1d25e7d0de_0000000000000079_ps.txt | 70 +++++-------------- .../4dc5fdeced670c5e_0000000000000079_ps.txt | 70 +++++-------------- .../cb0e6e8cbec4502a_0000000000000079_ps.txt | 66 +++++------------ .../45d85f1d25e7d0de_0000000000000079_ps.txt | 68 +++++------------- .../4dc5fdeced670c5e_0000000000000079_ps.txt | 68 +++++------------- .../cb0e6e8cbec4502a_0000000000000079_ps.txt | 38 ++++++++++ .../45d85f1d25e7d0de_0000000000000079_ps.txt | 68 +++++------------- .../4dc5fdeced670c5e_0000000000000079_ps.txt | 68 +++++------------- .../cb0e6e8cbec4502a_0000000000000079_ps.txt | 38 ++++++++++ .../45d85f1d25e7d0de_0000000000000079_ps.txt | 68 +++++------------- .../4dc5fdeced670c5e_0000000000000079_ps.txt | 68 +++++------------- .../cb0e6e8cbec4502a_0000000000000079_ps.txt | 66 +++++------------ .../45d85f1d25e7d0de_0000000000000079_ps.txt | 68 +++++------------- .../4dc5fdeced670c5e_0000000000000079_ps.txt | 68 +++++------------- .../cb0e6e8cbec4502a_0000000000000079_ps.txt | 38 ++++++++++ 30 files changed, 800 insertions(+), 816 deletions(-) create mode 100644 Enthusiast/BreathOfTheWild_2880p/45d85f1d25e7d0de_0000000000000079_ps.txt create mode 100644 Enthusiast/BreathOfTheWild_2880p/4dc5fdeced670c5e_0000000000000079_ps.txt create mode 100644 Enthusiast/BreathOfTheWild_2880p/cb0e6e8cbec4502a_0000000000000079_ps.txt create mode 100644 Enthusiast/BreathOfTheWild_4320p/45d85f1d25e7d0de_0000000000000079_ps.txt create mode 100644 Enthusiast/BreathOfTheWild_4320p/4dc5fdeced670c5e_0000000000000079_ps.txt create mode 100644 Enthusiast/BreathOfTheWild_4320p/cb0e6e8cbec4502a_0000000000000079_ps.txt create mode 100644 Enthusiast/BreathOfTheWild_5760p/45d85f1d25e7d0de_0000000000000079_ps.txt create mode 100644 Enthusiast/BreathOfTheWild_5760p/4dc5fdeced670c5e_0000000000000079_ps.txt create mode 100644 Enthusiast/BreathOfTheWild_5760p/cb0e6e8cbec4502a_0000000000000079_ps.txt create mode 100644 Quality/BreathOfTheWild_1080p/cb0e6e8cbec4502a_0000000000000079_ps.txt create mode 100644 Quality/BreathOfTheWild_1080pUW/cb0e6e8cbec4502a_0000000000000079_ps.txt create mode 100644 Quality/BreathOfTheWild_1440pUW/cb0e6e8cbec4502a_0000000000000079_ps.txt create mode 100644 Quality/BreathOfTheWild_1800p/cb0e6e8cbec4502a_0000000000000079_ps.txt create mode 100644 Quality/BreathOfTheWild_2160pUW/cb0e6e8cbec4502a_0000000000000079_ps.txt diff --git a/Enthusiast/BreathOfTheWild_2880p/45d85f1d25e7d0de_0000000000000079_ps.txt b/Enthusiast/BreathOfTheWild_2880p/45d85f1d25e7d0de_0000000000000079_ps.txt new file mode 100644 index 00000000..7cd51804 --- /dev/null +++ b/Enthusiast/BreathOfTheWild_2880p/45d85f1d25e7d0de_0000000000000079_ps.txt @@ -0,0 +1,36 @@ +#version 420 +#extension GL_ARB_texture_gather : enable + +const float factor = 2.0; //higher is less blur + +// shader 45d85f1d25e7d0de // vertical blur +layout(binding = 0) uniform sampler2D textureUnitPS0;// Tex0 addr 0xf4601800 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 = 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; } + +uniform float weight[] = float[]( 0.18571429, 0.28870130, 0.10363636, 0.01480519 ); +uniform float offset[] = float[]( 0.00000000, 1.42105263, 3.31578947, 5.21052632 ); + +ivec2 ires = textureSize(textureUnitPS0,0); +vec2 ores = vec2( float(ires.x), float(ires.y) ) * uf_fragCoordScale; +vec2 scale = ores * factor; +void main() +{ +vec2 R0f = vec2(passParameterSem0.x, passParameterSem0.w); +vec4 R1f = texture( textureUnitPS0, R0f ) * weight[0]; +for (int i=1; i<4; i++) { + R1f += texture( textureUnitPS0, R0f+(vec2(0.0, offset[i]) / scale) ) * weight[i]; + R1f += texture( textureUnitPS0, R0f-(vec2(0.0, offset[i]) / scale) ) * weight[i]; + } +passPixelColor0 = R1f; +} diff --git a/Enthusiast/BreathOfTheWild_2880p/4dc5fdeced670c5e_0000000000000079_ps.txt b/Enthusiast/BreathOfTheWild_2880p/4dc5fdeced670c5e_0000000000000079_ps.txt new file mode 100644 index 00000000..b4dcf1a3 --- /dev/null +++ b/Enthusiast/BreathOfTheWild_2880p/4dc5fdeced670c5e_0000000000000079_ps.txt @@ -0,0 +1,36 @@ +#version 420 +#extension GL_ARB_texture_gather : enable + +const float factor = 2.0; //higher is less blur + +// shader 4dc5fdeced670c5e // horizontal blur +layout(binding = 0) uniform sampler2D textureUnitPS0;// Tex0 addr 0xf45c5000 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 = 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; } + +uniform float weight[] = float[]( 0.18571429, 0.28870130, 0.10363636, 0.01480519 ); +uniform float offset[] = float[]( 0.00000000, 1.42105263, 3.31578947, 5.21052632 ); + +ivec2 ires = textureSize(textureUnitPS0,0); +vec2 ores = vec2( float(ires.x), float(ires.y) ) * uf_fragCoordScale; +vec2 scale = ores * factor; +void main() +{ +vec2 R0f = vec2(passParameterSem0.w, passParameterSem0.x); +vec4 R1f = texture( textureUnitPS0, R0f ) * weight[0]; +for (int i=1; i<4; i++) { + R1f += texture( textureUnitPS0, R0f+(vec2(offset[i], 0.0) / scale) ) * weight[i]; + R1f += texture( textureUnitPS0, R0f-(vec2(offset[i], 0.0) / scale) ) * weight[i]; + } +passPixelColor0 = R1f; +} diff --git a/Enthusiast/BreathOfTheWild_2880p/cb0e6e8cbec4502a_0000000000000079_ps.txt b/Enthusiast/BreathOfTheWild_2880p/cb0e6e8cbec4502a_0000000000000079_ps.txt new file mode 100644 index 00000000..74502800 --- /dev/null +++ b/Enthusiast/BreathOfTheWild_2880p/cb0e6e8cbec4502a_0000000000000079_ps.txt @@ -0,0 +1,38 @@ +#version 420 +#extension GL_ARB_texture_gather : enable +// shader cb0e6e8cbec4502a +layout(binding = 0) uniform sampler2D textureUnitPS0;// Tex0 addr 0xf5c7b800 res 1280x720x1 dim 1 tm: 4 format 0816 compSel: 0 1 2 5 mipView: 0x0 (num 0x1) sliceView: 0x0 (num 0x1) Sampler0 ClampX/Y/Z: 2 2 2 border: 1 +layout(location = 0) in vec4 passParameterSem3; +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; } + + +void main() +{ +vec2 R0f = vec2((passParameterSem3.x + passParameterSem3.z)/2, (passParameterSem3.y+passParameterSem3.w)/2); //center point +ivec2 ires = textureSize(textureUnitPS0,0); +vec2 res = vec2( float(ires.x), float(ires.y) ); +int r = int(floor(2.0 / uf_fragCoordScale.y + 0.5)); +vec4 R1f = vec4(0.0); +for (int i=0; i