From 87187a35fe7d0c8af23c141b6daee6736caa1025 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Hejl?= Date: Sat, 21 Oct 2023 08:51:46 +0200 Subject: [PATCH] Don't set view_model_matrix, projection_matrix, and view_normal_matrix in TriangleSelectorMmGui::render() because they are already set inside GLGizmoMmuSegmentation::render_triangles(). --- src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp b/src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp index 622ea89740..88bfa49da9 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoMmuSegmentation.cpp @@ -592,13 +592,8 @@ void TriangleSelectorMmGui::render(ImGuiWrapper* imgui, const Transform3d& matri auto *shader = wxGetApp().get_current_shader(); if (!shader) return; + assert(shader->get_name() == "mm_gouraud"); - const Camera& camera = wxGetApp().plater()->get_camera(); - const Transform3d& view_matrix = camera.get_view_matrix(); - shader->set_uniform("view_model_matrix", view_matrix * matrix); - shader->set_uniform("projection_matrix", camera.get_projection_matrix()); - const Matrix3d view_normal_matrix = view_matrix.matrix().block(0, 0, 3, 3) * matrix.matrix().block(0, 0, 3, 3).inverse().transpose(); - shader->set_uniform("view_normal_matrix", view_normal_matrix); for (size_t color_idx = 0; color_idx < m_gizmo_scene.triangle_indices.size(); ++color_idx) { if (m_gizmo_scene.has_VBOs(color_idx)) {