| 1 #version 400 core |
1 #version 400 core |
| 2 |
2 |
| 3 layout(location = 0) in vec2 position; |
3 layout(location = 0) in vec2 in_pos; |
| |
4 layout(location = 1) in vec2 in_uv; |
| 4 out vec2 texcoord; |
5 out vec2 texcoord; |
| 5 out vec2 uvcoord; |
6 out vec2 uvcoord; |
| 6 |
7 |
| 7 uniform mat4 projection; |
8 uniform mat4 projection; |
| 8 uniform mat4 view; |
9 uniform mat4 view; |
| 9 uniform mat4 model; |
10 uniform mat4 model; |
| 10 |
11 |
| 11 void main(void) { |
12 void main(void) { |
| 12 vec4 pos = projection*view*model*vec4(position.xy, 0.0, 1.0); |
13 vec4 pos = projection*view*model*vec4(in_pos.xy, 0.0, 1.0); |
| 13 gl_Position = pos; |
14 gl_Position = pos; |
| 14 uvcoord = position; |
15 uvcoord = in_uv; |
| 15 texcoord = vec2(model[0].x, model[1].y)*position; |
16 // TODO: we don't need that in the future |
| |
17 texcoord = vec2(model[0].x, model[1].y)*in_pos; |
| 16 } |
18 } |