summaryrefslogtreecommitdiffhomepage
path: root/shaders/tile-shader.vert
diff options
context:
space:
mode:
Diffstat (limited to 'shaders/tile-shader.vert')
-rw-r--r--shaders/tile-shader.vert6
1 files changed, 4 insertions, 2 deletions
diff --git a/shaders/tile-shader.vert b/shaders/tile-shader.vert
index 10b17f38..a7e9e660 100644
--- a/shaders/tile-shader.vert
+++ b/shaders/tile-shader.vert
@@ -2,7 +2,7 @@ precision highp float;
layout(location = 0) in vec4 position;
layout(location = 1) in vec2 textureCoordinates;
-layout(location = 0) uniform mat4 projection;
+layout(location = 0) uniform vec2 projection;
layout(location = 1) uniform float y_scale;
out vec2 interpolatedTextureCoordinates;
@@ -11,6 +11,8 @@ out float interpolated_frag_depth;
void main() {
interpolatedTextureCoordinates = textureCoordinates;
- gl_Position = projection * vec4(position.xy, 0, position.w) + vec4(0, position.z * y_scale, 0, 0);
+ float cx = 2/projection.x, cy = 2/projection.y;
+ float x = position.x, y = position.y, z = position.z*y_scale;
+ gl_Position = vec4((x-y)*cx, (x+y+z*2)*cx, 0, 1);
interpolated_frag_depth = -position.z;
}