From 32b5cfb1f50058da33a71b18983ce7fa7f643820 Mon Sep 17 00:00:00 2001 From: Enrico Turri <34307919+enricoturri1966@users.noreply.github.com> Date: Mon, 27 Jan 2025 12:22:52 +0100 Subject: [PATCH] Show bed numbers when the camera is below the bed --- src/slic3r/GUI/3DBed.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/3DBed.cpp b/src/slic3r/GUI/3DBed.cpp index e45f1f2a69..58f609c0d2 100644 --- a/src/slic3r/GUI/3DBed.cpp +++ b/src/slic3r/GUI/3DBed.cpp @@ -171,7 +171,9 @@ void Bed3D::render(GLCanvas3D& canvas, const Transform3d& view_matrix, const Tra shader->set_uniform("projection_matrix", projection_matrix); glsafe(::glEnable(GL_BLEND)); glsafe(::glEnable(GL_DEPTH_TEST)); - glsafe(glDepthMask(GL_FALSE)); + glsafe(::glDepthMask(GL_FALSE)); + const bool old_cullface = ::glIsEnabled(GL_CULL_FACE); + glsafe(::glDisable(GL_CULL_FACE)); glsafe(::glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)); glsafe(::glBindTexture(GL_TEXTURE_2D, m_digits_texture->get_id())); @@ -195,7 +197,9 @@ void Bed3D::render(GLCanvas3D& canvas, const Transform3d& view_matrix, const Tra m_digits_models[i + 1]->render(); } glsafe(::glBindTexture(GL_TEXTURE_2D, 0)); - glsafe(glDepthMask(GL_TRUE)); + if (old_cullface) + glsafe(::glEnable(GL_CULL_FACE)); + glsafe(::glDepthMask(GL_TRUE)); glsafe(::glDisable(GL_DEPTH_TEST)); shader->stop_using(); }