#version 430

layout (location=0) in vec3 vertexPosition;
//layout (location=1) in vec3 vertexNormal;
//layout (location=2) in vec2 vertexUV;
//layout (location=3) in vec3 vertexTangent;

out vec2 uv;

uniform mat4 projectionMatrix;
uniform mat4 modelViewMatrix;
uniform float g_time;

uniform float flip=1.0;

uniform float g_overlayScale = 1.0;

void main() {
  vec3 vp = (vertexPosition*2.0-1.0*vec3(1.0, 1.0, 1.0));
  //vp.y += sin(g_time+vp.x*10.2)*0.1;
  gl_Position = vec4(vp, 1.0);
  uv = vertexPosition.xy;
  if (flip > 0.5) {
      uv.y = 1.0-uv.y;
  }

  uv -= vec2(0.5, 0.5)*1.0;
  uv *= g_overlayScale;
  uv += vec2(0.5, 0.5)*1.0;

}
