summaryrefslogtreecommitdiffhomepage
path: root/shaders/tile.vert
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-10-25 16:41:21 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-10-25 16:41:21 +0200
commit0d97856bf6974450a8e72816be7bf271af04a458 (patch)
treea503cf7d7330970b468310a9c05860b8fbc7f3e4 /shaders/tile.vert
parentf1df7c20129a1f1cc47c47e5731efd10f8e49aeb (diff)
rename shader
Diffstat (limited to 'shaders/tile.vert')
-rw-r--r--shaders/tile.vert15
1 files changed, 15 insertions, 0 deletions
diff --git a/shaders/tile.vert b/shaders/tile.vert
new file mode 100644
index 00000000..8b3f2dba
--- /dev/null
+++ b/shaders/tile.vert
@@ -0,0 +1,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;
+noperspective out vec2 frag_texcoords;
+
+void main() {
+ float cx = 1/scale.x, cy = 1/scale.y;
+ float x = -position.y, y = -position.x, z = position.z;
+ gl_Position = vec4((x-y+offset.x)*cx, (x+y+z*2)*cy*.59-offset.y*cy, 0, 1);
+ frag_texcoords = texcoords;
+}