SPE-2632 - Fixed rendering of bed numbers (#13814)

This commit is contained in:
Enrico Turri 2025-01-27 11:28:08 +01:00 committed by Lukas Matena
parent 9490ae242f
commit f8dc44d12c

View File

@ -171,6 +171,7 @@ 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(::glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA));
glsafe(::glBindTexture(GL_TEXTURE_2D, m_digits_texture->get_id()));
@ -187,13 +188,14 @@ void Bed3D::render(GLCanvas3D& canvas, const Transform3d& view_matrix, const Tra
mat.translate(s_multiple_beds.get_bed_translation(i));
if (build_volume().type() != BuildVolume::Type::Circle)
mat.translate(Vec3d(0.3 * size_x, 0.3 * size_x, 0.));
mat.translate(Vec3d(0., 0., 0.5));
mat.translate(Vec3d(0., 0., 0.5 * GROUND_Z));
mat.scale(Vec3d(size_x, size_x * aspect, 1.));
shader->set_uniform("view_model_matrix", mat);
m_digits_models[i + 1]->render();
}
glsafe(::glBindTexture(GL_TEXTURE_2D, 0));
glsafe(glDepthMask(GL_TRUE));
glsafe(::glDisable(GL_DEPTH_TEST));
shader->stop_using();
}