summaryrefslogtreecommitdiffhomepage
path: root/shaders
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-10-03 14:10:10 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-10-03 14:10:10 +0200
commita21d15b01588c0cab6d27b4216a64ababc2eef09 (patch)
tree2bbb337e410a39548cbd5383e0768803b2b0825c /shaders
parenta16deb8ee39dd56f4b68a2808e4f619fd8d58ce7 (diff)
a
Diffstat (limited to 'shaders')
-rw-r--r--shaders/tile-shader.frag10
-rw-r--r--shaders/tile-shader.vert8
2 files changed, 6 insertions, 12 deletions
diff --git a/shaders/tile-shader.frag b/shaders/tile-shader.frag
index 0f487386..2204c991 100644
--- a/shaders/tile-shader.frag
+++ b/shaders/tile-shader.frag
@@ -1,12 +1,10 @@
precision highp float;
-uniform sampler2D samplers[32];
+uniform sampler2D sampler;
-in vec2 out_texcoords;
-flat in uint frag_sampler_id;
-out vec4 fragmentColor;
+in vec2 frag_texcoords;
+out vec4 color;
void main() {
- fragmentColor.rgb = texture(samplers[frag_sampler_id], out_texcoords).rgb;
- fragmentColor.a = 1;
+ color = vec4(texture(sampler, frag_texcoords).rgb, 1);
}
diff --git a/shaders/tile-shader.vert b/shaders/tile-shader.vert
index 17ead0d9..681a62a9 100644
--- a/shaders/tile-shader.vert
+++ b/shaders/tile-shader.vert
@@ -2,17 +2,13 @@ precision highp float;
layout (location = 0) uniform vec2 scale;
layout (location = 1) uniform vec2 offset;
-uniform sampler2D samplers[32];
in vec4 position;
in vec2 texcoords;
-in uint sampler_id;
-out vec2 out_texcoords;
-flat out uint frag_sampler_id;
+out vec2 frag_texcoords;
void main() {
- out_texcoords = texcoords;
- frag_sampler_id = sampler_id;
+ frag_texcoords = texcoords;
float cx = 2/scale.x, cy = 2/scale.y;
float x = position.y, y = position.x, z = position.z;