#version 300 es
precision highp float;

uniform sampler2D uPassTex;

in vec2 vUV;
in vec4 vUVs[4];

out vec4 fragColor;

vec4 getBlur(vec4 uvs[4]) {
    vec4 sum = texture(uPassTex, vUV);
    sum += texture(uPassTex, uvs[0].xy);
    sum += texture(uPassTex, uvs[0].zw) * 2.0;
    sum += texture(uPassTex, uvs[1].xy);
    sum += texture(uPassTex, uvs[1].zw) * 2.0;
    sum += texture(uPassTex, uvs[2].xy);
    sum += texture(uPassTex, uvs[2].zw) * 2.0;
    sum += texture(uPassTex, uvs[3].xy);
    sum += texture(uPassTex, uvs[3].zw) * 2.0;
    return sum * 0.0833;
}

void main() {
    // 检查是否在矩形内
    fragColor = getBlur(vUVs);
}