#version 400

uniform sampler2D shadowMap;

uniform float offset;

smooth in vec2 VS_TexCoord;
smooth in vec3 VS_ViewVector;

layout(location = 0) out vec4 fragColor;

void main()
{
	float width = 0.2;

	float top = offset + width;

	if(VS_TexCoord.t > offset && VS_TexCoord.s < width && VS_TexCoord.t < top)
	{
		vec2 tc = vec2(VS_TexCoord.s * 5,  (VS_TexCoord.t-offset) * 5);
		float depth = texture(shadowMap, tc).x;
		fragColor = vec4(depth);
		fragColor.a = 1.0;
	}
	else
		discard;
}
