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 } |