summaryrefslogtreecommitdiffhomepage
path: root/src/chunk-render.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-01-22 18:55:41 +0100
committerStanislaw Halik <sthalik@misaki.pl>2024-01-22 18:55:41 +0100
commit906f56a842c0e0e706087f80607ff6d816a23280 (patch)
tree730ed20091649482691baeaeae753dd40c468402 /src/chunk-render.cpp
parent49f455887a29a2a879e330dca9e050296e617720 (diff)
w
Diffstat (limited to 'src/chunk-render.cpp')
-rw-r--r--src/chunk-render.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/chunk-render.cpp b/src/chunk-render.cpp
index 459f51b7..3072f472 100644
--- a/src/chunk-render.cpp
+++ b/src/chunk-render.cpp
@@ -57,7 +57,7 @@ auto chunk::ensure_ground_mesh() noexcept -> ground_mesh_tuple
const auto& atlas = _ground->atlases[i];
const local_coords pos{i};
const auto quad = floor_quad(Vector3(pos) * TILE_SIZE, TILE_SIZE2);
- const auto texcoords = atlas->texcoords_for_id(_ground->variants[i]);
+ const auto texcoords = atlas->texcoords_for_id(_ground->variants[i] % _ground->atlases[i]->num_tiles());
const float depth = tile_shader::depth_value(pos, tile_shader::ground_depth_offset + hack_offset);
auto& v = vertexes[k];
for (auto j = 0uz; j < 4; j++)