Untitled

 avatar
unknown
glsl
2 years ago
346 B
84
Indexable
shader_type canvas_item;

uniform float start_x:hint_range(-1.0, 1.0, 0.001) = 0.0;
uniform float end_x:hint_range(-1.0, 1.0, 0.001) = 1.0;

void vertex() {
	UV.x = (UV.x * (end_x - start_x)) + start_x;
}

void fragment()
{

    if(UV.x>start_x && UV.x<end_x)
        COLOR = texture(TEXTURE,UV);
    else
        COLOR = vec4(0.0,0.0,0.0,0.0);
}
Editor is loading...