summaryrefslogtreecommitdiffhomepage
path: root/shaders/tile.vert
blob: ad038e6db93d540b67f4654115386d614440ca3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
precision highp float;

layout (location = 0) uniform vec2 scale;
layout (location = 1) uniform vec2 offset;

layout (location = 0) in vec4 position;
layout (location = 1) in vec2 texcoords;
layout (location = 2) in float depth;
noperspective out vec2 frag_texcoords;

void main() {
    float x = -position.y, y = -position.x, z = position.z;
    gl_Position = vec4((x-y+offset.x)*scale.x, ((x+y+z*2)*.59-offset.y)*scale.y, depth, 1);
    frag_texcoords = texcoords;
}