Skip to content

Instantly share code, notes, and snippets.

@jimmyjonezz
Created February 21, 2019 11:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimmyjonezz/a078b61f12fb869b50d9bc5719fdbaa9 to your computer and use it in GitHub Desktop.
Save jimmyjonezz/a078b61f12fb869b50d9bc5719fdbaa9 to your computer and use it in GitHub Desktop.
Blur Texture 3.1 alpha 5
shader_type canvas_item;
uniform float radius = 10.0;
void fragment(){
vec4 new_color = texture(TEXTURE, UV);
vec2 pixel_size = TEXTURE_PIXEL_SIZE;
new_color += texture(TEXTURE, UV + vec2(0, -radius) * pixel_size);
new_color += texture(TEXTURE, UV + vec2(0, radius) * pixel_size);
new_color += texture(TEXTURE, UV + vec2(-radius, 0) * pixel_size);
new_color += texture(TEXTURE, UV + vec2(radius, 0) * pixel_size);
COLOR = new_color / 5.0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment