diff options
author | davidovski <david@davidovski.xyz> | 2023-07-11 23:27:18 +0100 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2023-07-11 23:28:22 +0100 |
commit | bdf704744a19a0dc7ea13113321ba13b2fc0f598 (patch) | |
tree | 62cccf0402b4dccbcc72f9891f3ef068a7cf660a | |
parent | 3f2113f823f94ca91e93182cc5a2ab6b0ac5cfb6 (diff) |
add grid
-rw-r--r-- | tiled.glsl | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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; |