shader/sprite_vtx.glsl

changeset 102
0d94fd280c6e
parent 88
6234b7ea48f3
equal deleted inserted replaced
101:febf3dc10011 102:0d94fd280c6e
5 out vec2 uvcoord; 5 out vec2 uvcoord;
6 6
7 uniform mat4 projection; 7 uniform mat4 projection;
8 uniform mat4 view; 8 uniform mat4 view;
9 uniform mat4 model; 9 uniform mat4 model;
10 uniform float depth;
11 10
12 void main(void) { 11 void main(void) {
13 vec4 pos = projection*view*model*vec4(position.x, position.y, 0, 1.0); 12 vec4 pos = projection*view*model*vec4(position.xy, 0.0, 1.0);
14 // apply depth
15 pos.z = depth / -1024.0;
16 gl_Position = pos; 13 gl_Position = pos;
17 uvcoord = position; 14 uvcoord = position;
18 texcoord = vec2(model[0].x, model[1].y)*position; 15 texcoord = vec2(model[0].x, model[1].y)*position;
19 } 16 }

mercurial