summaryrefslogtreecommitdiffhomepage
path: root/shaders/tile-shader.frag
diff options
context:
space:
mode:
Diffstat (limited to 'shaders/tile-shader.frag')
-rw-r--r--shaders/tile-shader.frag10
1 files changed, 6 insertions, 4 deletions
diff --git a/shaders/tile-shader.frag b/shaders/tile-shader.frag
index f75a0478..8a31a1e1 100644
--- a/shaders/tile-shader.frag
+++ b/shaders/tile-shader.frag
@@ -1,12 +1,14 @@
+#version 450
precision highp float;
-layout(location = 2) uniform sampler2D textureData;
-
-in vec2 interpolatedTextureCoordinates;
+const int MAX_SAMPLERS = 16;
+layout (location = 0) uniform sampler2D samplers[MAX_SAMPLERS];
+layout (location = 0) in vec2 texcoord;
+layout (location = 1) flat in uint sampler_id;
out vec4 fragmentColor;
void main() {
- fragmentColor.rgb = texture(textureData, interpolatedTextureCoordinates).rgb;
+ fragmentColor.rgb = texture(samplers[sampler_id], texcoord).rgb;
fragmentColor.a = 1;
}