summaryrefslogtreecommitdiffhomepage
path: root/shaders/tile-shader.vert
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-07-27 18:01:44 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-07-27 18:01:44 +0200
commit97cfca98bde2a74257e2fa0d9112b77e4fa824f1 (patch)
tree4afa25ab5778d3581d1dfdf84654d67a041a3480 /shaders/tile-shader.vert
parent108ae0682d5d45eafc8dabe58b4509a54c66d837 (diff)
aa
Diffstat (limited to 'shaders/tile-shader.vert')
-rw-r--r--shaders/tile-shader.vert5
1 files changed, 3 insertions, 2 deletions
diff --git a/shaders/tile-shader.vert b/shaders/tile-shader.vert
index 03c1f08a..6241977b 100644
--- a/shaders/tile-shader.vert
+++ b/shaders/tile-shader.vert
@@ -3,6 +3,7 @@ precision highp float;
layout(location = 0) in vec4 position;
layout(location = 1) in vec2 textureCoordinates;
layout(location = 0) uniform vec2 scale;
+layout(location = 3) uniform vec2 offset;
out vec2 interpolatedTextureCoordinates;
out float interpolated_frag_depth;
@@ -11,7 +12,7 @@ void main() {
interpolatedTextureCoordinates = textureCoordinates;
float cx = 2/scale.x, cy = 2/scale.y;
- float x = position.x, y = position.y, z = position.z;
- gl_Position = vec4((x-y)*cx, (x+y+z*2)*cx*0.75, 0, 1);
+ float x = position.y, y = position.x, z = position.z;
+ gl_Position = vec4((x-y+offset.x)*cx, (x+y+z*2)*cx*0.75-offset.y*cx, 0, 1);
interpolated_frag_depth = -position.z;
}