Advertisement
bizarman

Desenfoque

May 17th, 2020
319
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. shader_type canvas_item;
  2.  
  3. uniform float radius = 0.0;
  4.  
  5. void fragment() {
  6. vec4 col = textureLod(SCREEN_TEXTURE, SCREEN_UV, 0.0);
  7. vec2 ps = TEXTURE_PIXEL_SIZE;
  8.  
  9. col += textureLod(SCREEN_TEXTURE, SCREEN_UV + vec2(-radius, -radius) * ps, 0.0);
  10. col += textureLod(SCREEN_TEXTURE, SCREEN_UV + vec2(0.0, -radius) * ps, 0.0);
  11. col += textureLod(SCREEN_TEXTURE, SCREEN_UV + vec2(radius, -radius) * ps, 0.0);
  12.  
  13. col += textureLod(SCREEN_TEXTURE,SCREEN_UV + vec2(-radius, 0.0) * ps, 0.0);
  14. col += textureLod(SCREEN_TEXTURE,SCREEN_UV + vec2(0.0, 0.0) * ps, 0.0);
  15. col += textureLod(SCREEN_TEXTURE,SCREEN_UV + vec2(radius, 0.0) * ps, 0.0);
  16.  
  17. col += textureLod(SCREEN_TEXTURE,SCREEN_UV + vec2(-radius, radius) * ps, 0.0);
  18. col += textureLod(SCREEN_TEXTURE,SCREEN_UV + vec2(0.0, radius) * ps, 0.0);
  19. col += textureLod(SCREEN_TEXTURE,SCREEN_UV + vec2(radius, radius) * ps, 0.0);
  20.  
  21. col /= 9.0;
  22.  
  23. COLOR = col;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement