Created
July 20, 2019 13:16
-
-
Save jimmyjonezz/36c386a335d6fc1ded47b8f88684bf23 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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