#version 410 uniform sampler2D texture1; uniform vec2 imageSize = vec2(1024, 1024); // the pixel size of the image. in vec2 uvV; out vec4 fragColor; uniform float weight[5] = float[]( 0.2270270270, 0.1945945946, 0.1216216216, 0.0540540541, 0.0162162162 ); void main(void) { fragColor = texture(texture1, uvV) * weight[0]; for (int i = 1; i < 5; i++) { vec2 bump = vec2(float(i) / imageSize.x, 0); fragColor += texture(texture1, uvV + bump) * weight[i]; fragColor += texture(texture1, uvV - bump) * weight[i]; } }