shader_type spatial; render_mode depth_draw_opaque,unshaded,depth_test_disabled; uniform sampler2D tex : source_color,filter_nearest; uniform vec4 color:source_color; uniform vec2 deformation_dir = vec2(1, 0); uniform float deformation_rate = 0; void vertex() { if (length(deformation_dir)>0.0){ vec2 dir_center = VERTEX.xy; vec2 dir = normalize(deformation_dir.yx); vec2 dir1 = dir * deformation_rate; vec2 dir2 = cross(vec3(0, 0, 1), vec3(dir, 0)).xy * deformation_rate; vec2 offset1 = -dot(dir1, dir_center) * dir1; vec2 offset2 = dot(dir2, dir_center) * dir2; VERTEX.xy += offset1 + offset2; } } void fragment() { vec4 col = texture(tex, UV); if(col.a<0.5){discard;} ALBEDO = color.rgb; ALPHA = 1.0; }