Skip to content

Instantly share code, notes, and snippets.

@ykob
Last active January 19, 2017 08:05
Show Gist options
  • Save ykob/b82e35f7fdac95719a928f6e388ff924 to your computer and use it in GitHub Desktop.
Save ykob/b82e35f7fdac95719a928f6e388ff924 to your computer and use it in GitHub Desktop.
uniform vec2 resolution;
uniform sampler2D texture;
const float blur = 16.0;
varying vec2 vUv;
void main() {
vec4 color = vec4(0.0);
for (float x = 0.0; x < blur; x++){
for (float y = 0.0; y < blur; y++){
color += texture2D(texture, vUv - (vec2(x, y) - vec2(blur / 2.0)) / resolution);
}
}
gl_FragColor = color / pow(blur, 2.0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment