blur.gdshader 414 B

1234567891011121314151617
  1. shader_type canvas_item;
  2. render_mode blend_mix;
  3. uniform float radius = 4.0;
  4. void fragment() {
  5. vec4 col = texture(TEXTURE, UV);
  6. vec2 ps = TEXTURE_PIXEL_SIZE;
  7. col += texture(TEXTURE, UV + vec2(0.0, -radius) * ps);
  8. col += texture(TEXTURE, UV + vec2(0.0, radius) * ps);
  9. col += texture(TEXTURE, UV + vec2(-radius, 0.0) * ps);
  10. col += texture(TEXTURE, UV + vec2(radius, 0.0) * ps);
  11. col /= 5.0;
  12. COLOR = col;
  13. }