// Draw a full screen quad in NDC (i.e., (x,y) in [-1..1])
//     * Assume vertex coming in has x,y = +/-1.
//     * Pass vertex down unchanged.
//     * Compute texture coord in [0..1]
//          -> Leave x/y = +1 from vertex unchanged as texcoord
//          -> Covert x/y = -1 to 0 for texcoord.

#version 400

in vec2 vertex;
out vec2 fragTexCoord;

void main ( void )
{
	fragTexCoord = vec2( vertex.x < 0 ? 0.0f : 1.0f, 
	                     vertex.y < 0 ? 0.0f : 1.0f );
	gl_Position  = vec4( vertex, 0.0, 1.0f );
}