shader_type spatial;
render_mode blend_mix, depth_draw_opaque, diffuse_lambert, specular_schlick_ggx, unshaded;

uniform sampler2D gradient;
uniform float drop_size;
uniform float stretch_compensatioon;
uniform float fill;
uniform float speed;
uniform float brightness;

void fragment() {

    float fresnel = 1.0/(1.0-abs(NORMAL.x));

    float dist = 1.0 / distance(vec2(NORMAL.x/stretch_compensatioon, UV.y), vec2(0.0, mod(-TIME*speed*UV.x, 1.0)));
    dist += 1.0 / distance(vec2(NORMAL.x/stretch_compensatioon, UV.y), vec2(0.0, mod(-TIME*speed*UV.x+0.3, 1.0)));
    //dist = 0.0;
    dist += 1.5 / distance(vec2(NORMAL.x/stretch_compensatioon, UV.y), vec2(0.0, fill));
    dist += 1.5 / distance(vec2(NORMAL.x/stretch_compensatioon, UV2.x), vec2(0.0, 1.1));

	ALBEDO = texture(gradient, UV2).xyz*brightness;
    ALPHA = float(int(dist > 1.0/drop_size));

}
