summaryrefslogtreecommitdiffhomepage
path: root/src/chunk-scenery.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/chunk-scenery.cpp')
-rw-r--r--src/chunk-scenery.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/chunk-scenery.cpp b/src/chunk-scenery.cpp
index 6c4a1b7c..b17b2e2a 100644
--- a/src/chunk-scenery.cpp
+++ b/src/chunk-scenery.cpp
@@ -159,7 +159,9 @@ auto chunk::ensure_scenery_mesh(scenery_scratch_buffers buffers) noexcept -> sce
const auto quad = atlas->frame_quad(coord, fr.r, fr.frame);
const auto& group = atlas->group(fr.r);
const auto texcoords = atlas->texcoords_for_frame(fr.r, fr.frame, !group.mirror_from.isEmpty());
- const float depth = tile_shader::depth_value(pos, tile_shader::scenery_depth_offset);
+ const auto depth2 = e->depth_offset();
+ const auto d = depth2.y() * TILE_MAX_DIM + depth2.x();
+ const float depth = tile_shader::depth_value(pos, d);
for (auto j = 0uz; j < 4; j++)
scenery_vertexes[i][j] = { quad[j], texcoords[j], depth };