Created
February 21, 2019 11:55
-
-
Save jimmyjonezz/a078b61f12fb869b50d9bc5719fdbaa9 to your computer and use it in GitHub Desktop.
Blur Texture 3.1 alpha 5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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