Skip to content

Instantly share code, notes, and snippets.

@jimmyjonezz
Created July 20, 2019 13:16
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 jimmyjonezz/36c386a335d6fc1ded47b8f88684bf23 to your computer and use it in GitHub Desktop.
Save jimmyjonezz/36c386a335d6fc1ded47b8f88684bf23 to your computer and use it in GitHub Desktop.
shader_type canvas_item;
uniform float percent : hint_range(0, 1);
void fragment(){
vec2 relative_uv = UV.yx - vec2(0.5);
float dist = abs(percent - distance(UV, vec2(0.5))) * 7.0;
float wave = pow(cos(dist)*sin(dist), 5.0);
vec2 displacement = (1.0/(percent+0.01)) * relative_uv * clamp(wave, 0.0, 1.0);
displacement *= 5.0 * pow(abs(length(relative_uv) - 0.65), 2.0) * (1.0 - percent);
COLOR = texture(SCREEN_TEXTURE, SCREEN_UV + displacement);
}
add a tween as a child and use it:
$Tween.interpolate_property(get_material(), 'shader_param/percent', 0, 1, 2,Tween.TRANS_EXPO, Tween.EASE_OUT)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment