Created
July 4, 2018 17:06
-
-
Save swarnimarun/4cd4ad6e3de7709e926c1b60594de508 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; | |
render_mode unshaded; | |
uniform sampler2D tex : hint_albedo; | |
uniform float deform_amt : hint_range(-1,1); | |
uniform float deform_speed : hint_range(0.5,4); | |
uniform bool animate; | |
void fragment() { | |
float def_amt = deform_amt; | |
vec4 cl = texture(tex, UV); | |
if (animate) | |
def_amt *= sin(TIME * deform_speed); | |
COLOR = texture(TEXTURE, clamp(UV + cl.r * def_amt / 2.0, vec2(0.0), vec2(1.0))); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment