From 65f7aada602bccf1a3e595c268023950ccb4b51e Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Mon, 28 Mar 2022 15:56:03 +0200 Subject: [PATCH] Tech ENABLE_GL_CORE_PROFILE - Use thick line for layers editing profile rendering --- src/slic3r/GUI/GLCanvas3D.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 7e03116bf4..666a6d58ca 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -501,11 +501,21 @@ void GLCanvas3D::LayersEditing::render_profile(const Rect& bar_rect) m_profile.profile.init_from(std::move(init_data)); } +#if ENABLE_GL_CORE_PROFILE + GLShaderProgram* shader = wxGetApp().get_shader("dashed_thick_lines"); +#else GLShaderProgram* shader = wxGetApp().get_shader("flat"); +#endif // ENABLE_GL_CORE_PROFILE if (shader != nullptr) { shader->start_using(); shader->set_uniform("view_model_matrix", Transform3d::Identity()); shader->set_uniform("projection_matrix", Transform3d::Identity()); +#if ENABLE_GL_CORE_PROFILE + const std::array& viewport = wxGetApp().plater()->get_camera().get_viewport(); + shader->set_uniform("viewport_size", Vec2d(double(viewport[2]), double(viewport[3]))); + shader->set_uniform("width", 0.25f); + shader->set_uniform("gap_size", 0.0f); +#endif // ENABLE_GL_CORE_PROFILE m_profile.baseline.render(); m_profile.profile.render(); shader->stop_using();