From f5c387da470ae43a2c8aff75b419e784c8bb3bc5 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 14 Apr 2023 11:58:23 +0200 Subject: it probably renders correctly now --- main/draw.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'main') diff --git a/main/draw.cpp b/main/draw.cpp index 51031427..0e4ecc9f 100644 --- a/main/draw.cpp +++ b/main/draw.cpp @@ -127,7 +127,6 @@ void main_impl::draw_world() noexcept GL::defaultFramebuffer.clearDepth(0); #endif GL::Renderer::enable(GL::Renderer::Feature::DepthTest); - GL::Renderer::setDepthMask(true); for (int8_t z = z_max; z >= z_min; z--) @@ -160,6 +159,11 @@ void main_impl::draw_world() noexcept for (int16_t y = miny; y <= maxy; y++) for (int16_t x = minx; x <= maxx; x++) { + if (only && z != z_cur) + _shader.set_tint({1, 1, 1, 0.75}); + else + _shader.set_tint({1, 1, 1, 1}); + const chunk_coords_ pos{x, y, z}; auto* c_ = _world.at(pos); if (!c_) @@ -170,6 +174,7 @@ void main_impl::draw_world() noexcept _anim_mesh.draw(_shader, sz, c, _clickable_scenery); } + _shader.set_tint({1, 1, 1, 1}); GL::Renderer::setDepthMask(true); GL::Renderer::disable(GL::Renderer::Feature::DepthTest); -- cgit v1.2.3