mirage.gdshader 352 B

1234567891011121314
  1. shader_type canvas_item;
  2. uniform sampler2D screen_texture : hint_screen_texture, filter_linear_mipmap;
  3. uniform float frequency = 60;
  4. uniform float depth = 0.005;
  5. void fragment() {
  6. vec2 uv = SCREEN_UV;
  7. uv.x += sin(uv.y * frequency + TIME) * depth;
  8. uv.x = clamp(uv.x, 0.0, 1.0);
  9. vec3 c = textureLod(screen_texture, uv, 0.0).rgb;
  10. COLOR.rgb = c;
  11. }