2017-10-07 18:49:32 +02:00
|
|
|
#version 420
|
|
|
|
#extension GL_ARB_texture_gather : enable
|
2017-10-13 05:48:39 +02:00
|
|
|
// shader 6279271034da8f93 // horizontal bloom 1800
|
2017-10-08 06:24:22 +02:00
|
|
|
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
|
2017-10-07 18:49:32 +02:00
|
|
|
layout(location = 0) in vec4 passParameterSem0;
|
2017-10-08 06:24:22 +02:00
|
|
|
layout(location = 1) in vec4 passParameterSem1;
|
2017-10-07 18:49:32 +02:00
|
|
|
layout(location = 0) out vec4 passPixelColor0;
|
2017-10-08 06:24:22 +02:00
|
|
|
uniform vec2 uf_fragCoordScale;
|
|
|
|
|
|
|
|
float data = passParameterSem0.z - passParameterSem0.w;
|
|
|
|
float w = data / 1.38461538 * uf_fragCoordScale.x;
|
2017-10-07 18:49:32 +02:00
|
|
|
|
2017-10-13 05:48:39 +02:00
|
|
|
uniform float o_weight[] = float[]( 0.22702703, 0.31621622, 0.07027027 );
|
|
|
|
uniform float o_offset[] = float[]( 0.00000000, 1.38461538, 3.23076923 );
|
2017-10-08 06:24:22 +02:00
|
|
|
|
|
|
|
uniform float weight[] = float[]( 0.13583460, 0.23632042, 0.13504024, 0.04857179, 0.01068579, 0.00136997, 0.00009448 );
|
|
|
|
uniform float offset[] = float[]( 0.00000000, 1.45714286, 3.40000000, 5.34285714, 7.28571429, 9.22857143, 11.17142857 );
|
2017-10-07 18:49:32 +02:00
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
2017-10-08 06:24:22 +02:00
|
|
|
vec2 R0f = vec2(passParameterSem0.w, passParameterSem0.x);
|
|
|
|
|
|
|
|
vec4 R1f = texture( textureUnitPS0, R0f ) * weight[0];
|
|
|
|
for (int i=1; i<7; 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];
|
2017-10-07 18:49:32 +02:00
|
|
|
}
|
2017-10-08 06:24:22 +02:00
|
|
|
|
|
|
|
vec4 R2f = texture( textureUnitPS0, R0f ) * o_weight[0];
|
2017-10-13 05:48:39 +02:00
|
|
|
for (int i=1; i<3; i++) {
|
2017-10-08 06:24:22 +02:00
|
|
|
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 5 --reduce 5 25 --linear
|
|
|
|
//game original --expand 2 --reduce 2 9 --linear
|