From a21d15b01588c0cab6d27b4216a64ababc2eef09 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 3 Oct 2022 14:10:10 +0200 Subject: a --- shaders/tile-shader.frag | 10 ++++------ shaders/tile-shader.vert | 8 ++------ 2 files changed, 6 insertions(+), 12 deletions(-) (limited to 'shaders') 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; -- cgit v1.2.3