Skip to content

Instantly share code, notes, and snippets.

@rmichaluszek
Created February 3, 2018 15:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rmichaluszek/456f141c974c30a2ef1c664a54997a20 to your computer and use it in GitHub Desktop.
Save rmichaluszek/456f141c974c30a2ef1c664a54997a20 to your computer and use it in GitHub Desktop.
shader_type canvas_item;
uniform float frequency=5;
uniform float depth = 0.01;
uniform float speed_multiplier = 2.0;
void fragment() {
float multiplier = 1.0-(UV.y+0.3);
if(multiplier <= 0.0) {
multiplier = 0.0;
}
vec2 uv = UV;
uv.x += sin(uv.y*frequency+(TIME*speed_multiplier))*depth*multiplier;
uv.x = clamp(uv.x,0,1);
vec4 c = textureLod(TEXTURE,uv,0.0).rgba;
COLOR.rgba=c;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment