#version 130

#pragma vertex_shader

in vec4 vertex;
in vec2 texCoord;

uniform mat4  transform;
uniform float offset;


out vec2 texcoord;

void main() {
	vec4 pos = vertex;
	pos.y += offset;
	gl_Position = transform * pos;
	texcoord = texCoord;
}

#pragma fragment_shader

in vec2 texcoord;
out vec4 fragment;

uniform float value;
uniform vec3 colour;

void main() {
	vec4 diff = vec4(colour, 1);
	diff.rgb *= step(1-texcoord.x, value);

	float h1 = 1-step(abs(texcoord.y-0.5), 0.4);
	float h2 = 1-step(abs(texcoord.x-0.5), 0.48);
	diff.rgb += h1 + h2;


	fragment = diff;
}

