shader/sprite_vtx.glsl

changeset 41
df81d493716e
parent 40
6c438be1a1fd
child 42
cc912686f663
equal deleted inserted replaced
40:6c438be1a1fd 41:df81d493716e
3 layout(location = 0) in vec2 position; 3 layout(location = 0) in vec2 position;
4 out vec2 texcoord; 4 out vec2 texcoord;
5 5
6 uniform mat4 projection; 6 uniform mat4 projection;
7 uniform mat4 model; 7 uniform mat4 model;
8 uniform float depth;
8 9
9 void main(void) { 10 void main(void) {
10 gl_Position = projection*model*vec4(position, 0.0, 1.0); 11 vec4 pos = projection*model*vec4(position.x, position.y, 0, 1.0);
12 // apply depth
13 pos.z = depth / -256.0;
14 gl_Position = pos;
11 texcoord = vec2(model[0].x, model[1].y)*position; 15 texcoord = vec2(model[0].x, model[1].y)*position;
12 } 16 }

mercurial