Advertisement
Guest User

Untitled

a guest
Mar 26th, 2024
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. shader_type canvas_item;
  2.  
  3. uniform sampler2D SCREEN_TEXTURE: hint_screen_texture, filter_linear;
  4. uniform sampler2D NOISE_TEXTURE: repeat_enable;
  5. uniform float strength: hint_range(0.0, 5, 0.1) = 5.0;
  6. uniform float uv_scaling: hint_range (0.0, 1.0, 0.05) = 1.0;
  7. uniform vec2 movement_direction = vec2(1, 1);
  8. uniform float movement_speed: hint_range (0.0, 0.5, 0.01) = 0.5;
  9.  
  10. void fragment() {
  11.     vec2 uv = SCREEN_UV;
  12.     vec2 movement_factor = movement_direction * movement_speed * TIME;
  13.     float noise_value = texture(NOISE_TEXTURE, uv*uv_scaling + movement_factor).r - 0.5;
  14.     uv += noise_value * SCREEN_PIXEL_SIZE * strength;
  15.     COLOR = texture(SCREEN_TEXTURE, uv);
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement