mirror of
https://github.com/cemu-project/cemu_graphic_packs.git
synced 2024-11-27 12:04:14 +01:00
41 lines
1.9 KiB
Plaintext
41 lines
1.9 KiB
Plaintext
|
#version 420
|
||
|
#extension GL_ARB_texture_gather : enable
|
||
|
// shader 9fad3b3505a6d831
|
||
|
// Used for: Horizontal Bloom 5760
|
||
|
// Implementation of http://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/
|
||
|
|
||
|
layout(binding = 0) uniform sampler2D textureUnitPS0;
|
||
|
layout(location = 0) in vec4 passParameterSem0;
|
||
|
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.22558594, 0.31420898, 0.06982422, 0.00317383 );
|
||
|
uniform float o_offset[] = float[]( 0.00000000, 1.38461538, 3.23076923, 5.07692308 );
|
||
|
|
||
|
uniform float weight[] = float[]( 0.06731324, 0.12996513, 0.11288345, 0.08757379, 0.06065717, 0.03748843, 0.02065758, 0.01013916, 0.00442739, 0.00171752, 0.00059095, 0.00017999, 0.00004843, 0.00001148, 0.00000239, 0.00000044, 0.00000007, 0.00000001 );
|
||
|
uniform float offset[] = float[]( 0.00000000, 1.48936170, 3.47517730, 5.46099291, 7.44680851, 9.43262411, 11.41843972, 13.40425532, 15.39007092, 17.37588652, 19.36170213, 21.34751773, 23.33333333, 25.31914894, 27.30496454, 29.29078014, 31.27659574, 33.26241135 );
|
||
|
|
||
|
void main()
|
||
|
{
|
||
|
vec2 R0f = vec2(passParameterSem0.w, passParameterSem0.x);
|
||
|
|
||
|
vec4 R1f = texture( textureUnitPS0, R0f ) * weight[0];
|
||
|
for (int i=1; i<18; i++) {
|
||
|
R1f += texture( textureUnitPS0, R0f + vec2(offset[i]*h, 0.0) ) * weight[i];
|
||
|
R1f += texture( textureUnitPS0, R0f - vec2(offset[i]*h, 0.0) ) * weight[i];
|
||
|
}
|
||
|
|
||
|
vec4 R2f = texture( textureUnitPS0, R0f ) * o_weight[0];
|
||
|
for (int i=1; i<4; i++) {
|
||
|
R2f += texture( textureUnitPS0, R0f + vec2(o_offset[i]*h, 0.0) ) * o_weight[i];
|
||
|
R2f += texture( textureUnitPS0, R0f - vec2(o_offset[i]*h, 0.0) ) * o_weight[i];
|
||
|
}
|
||
|
|
||
|
passPixelColor0 = ( (uf_fragCoordScale.y == 1.0) ? R2f : R1f );
|
||
|
}
|
||
|
|
||
|
//py blurninja.py --expand 18 --reduce 18 105 --linear
|
||
|
// game original py blurninja.py --expand 0 --reduce 0 13 --linear
|