summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2023-07-11 23:27:18 +0100
committerdavidovski <david@davidovski.xyz>2023-07-11 23:28:22 +0100
commitbdf704744a19a0dc7ea13113321ba13b2fc0f598 (patch)
tree62cccf0402b4dccbcc72f9891f3ef068a7cf660a
parent3f2113f823f94ca91e93182cc5a2ab6b0ac5cfb6 (diff)
add grid
-rw-r--r--tiled.glsl6
1 files 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;