#version 400 

// Uniform matrix passed down directly from the OpenGL code
uniform mat4 mvp;

// Are we drawing over the whole image, or a lower resolution part?
uniform float passScale;

// Per-vertex position data passed down from OpenGL via a vertex array
layout(location = IGLU_VERTEX)   in vec3 vertex;  

// Output to the rasterizer/fragment shader to identify fragment locations on screen
out vec2 texelPos;

// This is the actual code that is executed.
void main( void )
{ 
	texelPos    = vertex.xy;
	gl_Position = mvp * ( vec4( passScale * vertex.xy, 0, 1 ) ); 
}