mirror of
https://github.com/cemu-project/cemu_graphic_packs.git
synced 2024-11-26 03:24:15 +01:00
df950f92d5
the old way used in menu blur is kinda hacky (cuz i found the games's original blur is linear sampled 5x5, not jump lines), and seems to have some negative effect when used on bloom (pixelation) so back to increasing taps, however as the image size goes up, it becomes quite harder/impossible to get the same blurry result for some reason. 5x5 menu blur ends up in 100 taps in 10k to get the similar blur, and 9x9 used in bloom is even blurrier... so i give up trying to get the same blur by increasing a lot taps, but just scale linearly to fix pixelation first and wait for a better solution. also the texturesize() returns weird value when mipmap is present, so changed to calculate the image size from the data passed from vertex shader (as we already figured out what blur is used so offset is known).
40 lines
2.0 KiB
Plaintext
40 lines
2.0 KiB
Plaintext
#version 420
|
|
#extension GL_ARB_texture_gather : enable
|
|
// shader 6279271034da8f93 // horizontal bloom 10240
|
|
layout(binding = 0) uniform sampler2D textureUnitPS0;// Tex0 addr 0xf4247000 res 96x96x1 dim 1 tm: 4 format 0005 compSel: 0 4 4 5 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 w = data / 1.38461538 * uf_fragCoordScale.x;
|
|
|
|
uniform float o_weight[] = float[]( 0.29411765, 0.35294118 );
|
|
uniform float o_offset[] = float[]( 0.00000000, 1.33333333 );
|
|
|
|
uniform float weight[] = float[]( 0.05842515, 0.11378184, 0.10229613, 0.08445599, 0.06401931, 0.04454418, 0.02843975, 0.01665463, 0.00894132, 0.00439816, 0.00198084, 0.00081621, 0.00030743, 0.00010575, 0.00003318, 0.00000949, 0.00000247, 0.00000058, 0.00000013, 0.00000002 );
|
|
uniform float offset[] = float[]( 0.00000000, 1.49197861, 3.48128342, 5.47058824, 7.45989305, 9.44919786, 11.43850267, 13.42780749, 15.41711230, 17.40641711, 19.39572193, 21.38502674, 23.37433155, 25.36363636, 27.35294118, 29.34224599, 31.33155080, 33.32085561, 35.31016043, 37.29946524 );
|
|
|
|
void main()
|
|
{
|
|
vec2 R0f = vec2(passParameterSem0.w, passParameterSem0.x);
|
|
|
|
vec4 R1f = texture( textureUnitPS0, R0f ) * weight[0];
|
|
for (int i=1; i<20; i++) {
|
|
R1f += texture( textureUnitPS0, R0f + vec2(offset[i]*w, 0.0) ) * weight[i];
|
|
R1f += texture( textureUnitPS0, R0f - vec2(offset[i]*w, 0.0) ) * weight[i];
|
|
}
|
|
|
|
vec4 R2f = texture( textureUnitPS0, R0f ) * o_weight[0];
|
|
for (int i=1; i<2; i++) {
|
|
R2f += texture( textureUnitPS0, R0f + vec2(o_offset[i]*w, 0.0) ) * o_weight[i];
|
|
R2f += texture( textureUnitPS0, R0f - vec2(o_offset[i]*w, 0.0) ) * o_weight[i];
|
|
}
|
|
|
|
passPixelColor0 = ( (uf_fragCoordScale.y == 1.0) ? R2f : R1f );
|
|
}
|
|
|
|
//py blurninja.py --expand 29 --reduce 29 129 --linear
|
|
//game original --expand 2 --reduce 2 9 --linear
|