Advertisement
Guest User

Untitled

a guest
Oct 4th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. shader_type canvas_item;
  2.  
  3. vec4 blur13(sampler2D image, vec2 uv, vec2 resolution, vec2 direction) {
  4.   vec4 color = vec4(0.0);
  5.   vec2 off1 = vec2(1.411764705882353) * direction;
  6.   vec2 off2 = vec2(3.2941176470588234) * direction;
  7.   vec2 off3 = vec2(5.176470588235294) * direction;
  8.   color += texture(image, uv) * 0.1964825501511404;
  9.   color += texture(image, uv + (off1 / resolution)) * 0.2969069646728344;
  10.   color += texture(image, uv - (off1 / resolution)) * 0.2969069646728344;
  11.   color += texture(image, uv + (off2 / resolution)) * 0.09447039785044732;
  12.   color += texture(image, uv - (off2 / resolution)) * 0.09447039785044732;
  13.   color += texture(image, uv + (off3 / resolution)) * 0.010381362401148057;
  14.   color += texture(image, uv - (off3 / resolution)) * 0.010381362401148057;
  15.   return color;
  16. }
  17.  
  18. void fragment() {
  19.     COLOR = blur13(SCREEN_TEXTURE, SCREEN_UV, vec2(100, 100), vec2(1, 1));
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement