shader/sprite_vtx.glsl

changeset 115
e5f8c99b0987
parent 102
0d94fd280c6e
equal deleted inserted replaced
114:5b91bbab1ac0 115:e5f8c99b0987
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 }

mercurial