summaryrefslogtreecommitdiff
path: root/assets/shaders/2d_overlay.vsh
blob: 512ef9114021d65fd663b31b75e72d61a0c7b7db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
attribute vec4 in_position;
attribute vec2 in_texcoord;
attribute vec2 in_texcoord2;

varying vec2 g_texcoord;
varying vec2 g_texcoord2;
uniform vec4 g_screenratio;

void main() {
  vec2 halfscreen = vec2( 1.0 / g_screenratio[0], 1.0 / g_screenratio[1] );

  vec4 pos = in_position;
  pos[0] -= halfscreen[0];
  pos[1] -= halfscreen[1];
  pos[1] *= -1.0;

  gl_Position = ( pos ) * g_screenratio;
  g_texcoord  = in_texcoord;
  g_texcoord2 = in_texcoord2;
}