blur3.shader 401 B

1234567891011121314151617181920
  1. shader_type canvas_item;
  2. uniform float radius = 0.009;
  3. float rand(vec2 co){
  4. return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453)*radius;
  5. }
  6. void fragment() {
  7. vec3 col = vec3(0);
  8. for (int i = 0; i < 10; i++) {
  9. col+=texture(SCREEN_TEXTURE,SCREEN_UV+vec2(rand(SCREEN_UV+vec2(0,TIME-float(i))),rand(SCREEN_UV+vec2(0,TIME-float(i)-1200.0)))).rgb
  10. }
  11. col/=10.0;
  12. COLOR.rgb=col;
  13. }