From 7f542a0f851590846625772e88934f9cc689809c Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Fri, 24 Aug 2018 11:17:53 +0200 Subject: [PATCH] 3D gizmos grabbers always visible to picking pass --- xs/src/slic3r/GUI/GLCanvas3D.cpp | 15 +++++++++------ xs/src/slic3r/GUI/GLGizmo.cpp | 6 +----- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/xs/src/slic3r/GUI/GLCanvas3D.cpp b/xs/src/slic3r/GUI/GLCanvas3D.cpp index 11a97b6f0..40362ac87 100644 --- a/xs/src/slic3r/GUI/GLCanvas3D.cpp +++ b/xs/src/slic3r/GUI/GLCanvas3D.cpp @@ -2352,13 +2352,14 @@ void GLCanvas3D::render() float theta = m_camera.get_theta(); bool is_custom_bed = m_bed.is_custom(); + // picking pass _picking_pass(); - _render_background(); + // draw scene + _render_background(); _render_current_gizmo(); - // untextured bed needs to be rendered before objects - if (is_custom_bed) + if (is_custom_bed) // untextured bed needs to be rendered before objects { _render_bed(theta); // disable depth testing so that axes are not covered by ground @@ -2366,13 +2367,15 @@ void GLCanvas3D::render() } _render_objects(); - // textured bed needs to be rendered after objects - if (!is_custom_bed) + if (!is_custom_bed) // textured bed needs to be rendered after objects { _render_axes(true); _render_bed(theta); } + _render_cutting_plane(); + + // draw overlays _render_gizmos_overlay(); _render_warning_texture(); _render_legend_texture(); @@ -3819,8 +3822,8 @@ void GLCanvas3D::_picking_pass() const ::glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - m_gizmos.render_current_gizmo_for_picking_pass(_selected_volumes_bounding_box()); _render_volumes(true); + m_gizmos.render_current_gizmo_for_picking_pass(_selected_volumes_bounding_box()); if (m_multisample_allowed) ::glEnable(GL_MULTISAMPLE); diff --git a/xs/src/slic3r/GUI/GLGizmo.cpp b/xs/src/slic3r/GUI/GLGizmo.cpp index 34d1f2efc..0ff5909a0 100644 --- a/xs/src/slic3r/GUI/GLGizmo.cpp +++ b/xs/src/slic3r/GUI/GLGizmo.cpp @@ -373,11 +373,7 @@ void GLGizmoRotate::on_render(const BoundingBoxf3& box) const void GLGizmoRotate::on_render_for_picking(const BoundingBoxf3& box) const { -#if ENABLE_GIZMOS_3D - ::glEnable(GL_DEPTH_TEST); -#else ::glDisable(GL_DEPTH_TEST); -#endif // ENABLE_GIZMOS_3D ::glPushMatrix(); transform_to_local(); @@ -926,7 +922,7 @@ void GLGizmoScale3D::on_render(const BoundingBoxf3& box) const void GLGizmoScale3D::on_render_for_picking(const BoundingBoxf3& box) const { - ::glEnable(GL_DEPTH_TEST); + ::glDisable(GL_DEPTH_TEST); for (unsigned int i = 0; i < (unsigned int)m_grabbers.size(); ++i) {