From bdf704744a19a0dc7ea13113321ba13b2fc0f598 Mon Sep 17 00:00:00 2001 From: davidovski Date: Tue, 11 Jul 2023 23:27:18 +0100 Subject: add grid --- tiled.glsl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tiled.glsl b/tiled.glsl index ce7ebea..7fdf91e 100644 --- a/tiled.glsl +++ b/tiled.glsl @@ -18,7 +18,7 @@ uniform ivec2 mapSize; out vec4 finalColor; const vec4 none = vec4(0.0f, 0.0f, 0.0f, 0.0f); -const vec4 gridColor = vec4(0.0f, 0.0f, 0.0f, 0.2f); +const vec4 gridColor = vec4(0.0f, 0.0f, 0.0f, 0.05f); bool outBounds(vec2 coords, vec2 area) { return coords.x > area.x @@ -35,8 +35,8 @@ ivec2 calcTileOffset(int tileIndex) { } vec4 drawGrid(vec2 coords) { - if (abs(floor(coords.x) - coords.x) < 1/16 - || abs(floor(coords.y) - coords.y) < 1/16) { + if (abs(floor(coords.x) - coords.x) < 1/16.0f + || abs(floor(coords.y) - coords.y) < 1/16.0f) { return gridColor; } else { return none; -- cgit v1.2.1