diff --git a/resources/profiles/BIBO.idx b/resources/profiles/BIBO.idx index 08676caf37..85cc0fd1b0 100644 --- a/resources/profiles/BIBO.idx +++ b/resources/profiles/BIBO.idx @@ -1,3 +1,6 @@ +min_slic3r_version = 2.4.1-beta3 +0.0.5 Correct Marlin Error accumulation for Ditto printer profiles. +0.0.4 Correct Marlin Error accumulation min_slic3r_version = 2.3.0-beta2 0.0.3 Removed obsolete host keys. min_slic3r_version = 2.2.0-alpha3 diff --git a/resources/profiles/BIBO.ini b/resources/profiles/BIBO.ini index db8504c2e1..15e9c51a67 100644 --- a/resources/profiles/BIBO.ini +++ b/resources/profiles/BIBO.ini @@ -5,7 +5,7 @@ name = BIBO # Configuration version of this file. Config file will only be installed, if the config_version differs. # This means, the server may force the PrusaSlicer configuration to be downgraded. -config_version = 0.0.3 +config_version = 0.0.5 # Where to get the updates from? config_update_url = https://files.prusa3d.com/wp-content/uploads/repository/PrusaSlicer-settings-master/live/BIBO/ @@ -694,7 +694,7 @@ cooling = 1 [printer:*common*] printer_technology = FFF bed_shape = -107x-93,107x-93,107x93,-107x93 -before_layer_gcode = ;BEFORE_LAYER_CHANGE\n;[layer_z]\n\n +before_layer_gcode = ;BEFORE_LAYER_CHANGE\n;[layer_z]\nG92 E0\n between_objects_gcode = deretract_speed = 0 # By setting this value to 0 deretract used the retract_speed extruder_colour = #FFFF00 @@ -837,7 +837,7 @@ printer_notes = Do not remove the following keywords! These keywords are used in bed_shape = 0x-93,33x-93,33x93,0x93 #bed_model = BIBO2_bed.stl #bed_texture = BIBO2.svg -before_layer_gcode = ;BEFORE_LAYER_CHANGE\n;[layer_z]\nM104 S{temperature[0]} T1 ; set 2nd nozzle heater to print temperature\n +before_layer_gcode = ;BEFORE_LAYER_CHANGE\n;[layer_z]\nM104 S{temperature[0]} T1 ; set 2nd nozzle heater to print temperature\nG92 E0\n start_gcode = ;Start code PrusaSlicer BIBO 2 printers E1 only (i.e. T0)\nM420 S1 ; Turn on Ditto Printing\nG21 ; set units to metric\nG90 ; absolute positioning\nM107 ; start with the fan off\nM190 S{first_layer_bed_temperature[0] - 5} ; wait for bed temp\nM140 S{first_layer_bed_temperature[0]} ; continue bed heating to full temp while other things are happening\nM104 S{first_layer_temperature[0]} T0 ; set 1st nozzle heater to first layer temperature\nM104 S{first_layer_temperature[0]} T1 ; set 2nd nozzle heater to same first layer temperature\nM105 ; Report Temperatures\nM109 S{first_layer_temperature[0]} T0 ; wait for 1st nozzle heat to first layer temperature\nM109 S{first_layer_temperature[0]} T1 ; wait for 2nd nozzle heat to same first layer temperature\nM105 ; Report Temperatures\nG28 X0 Y0 ; move X/Y to min endstops\nG28 Z0 ; move Z to min endstops\nG1 Y0 F1200 E0 ; move Y to min endstop and extrude 0 filament\nT[initial_tool] ; switch to initial tool position\nG92 E0.0 ; reset extruder\nG28 ; Home all axis\nG1 Y0 F1200 E0 ; move Y to min endstop and reset extruder\nG92 E0.0 ; zero the current extruder coordinate\nM117 Cleaning... ; Put Cleaning message on screen, Attempt Nozzle Wipe (for ooze free startup)\nG1 X-15.0 Y-92.9 Z0.3 F2400.0 ; move to start-line position\nG1 X15.0 Y-92.9 Z0.3 F1000.0 E2 ; draw 1st line\nG1 X15.0 Y-92.6 Z0.3 F3000.0 ; move to side a little\nG1 X-15.0 Y-92.6 Z0.3 F1000.0 E4 ; draw 2nd line\nG1 X-15.0 Y-92.3 Z0.3 F3000.0 ; move to side a little\nG1 X15.0 Y-92.3 Z0.3 F1000.0 E6 ; draw 3rd line\nG1 X15.0 Y-92 Z0.3 F3000.0 ; move to side a little\nG1 X-15.0 Y-92 Z0.3 F1000.0 E8 ; draw 4th line\nG92 E0.0 ; reset extruder and zero the current extruder coordinate before printing\nM117 BIBO E1 now Printing... ; Put now printing message on screen end_gcode = ;BIBO End GCode\nM107 ; turn fans off\nG91 ; Relative positioning\nG1 Z1 F100\nM140 S0 ; Disable heated bed\nM104 T0 S0 ; extruder T0 heater off\nM104 T1 S0 ; extruder T1 heater off\nG1 Z+0.5 X-20 Y-20 F300 ; move Z down then move print head a bit out of the way\nG28 X0 Y0 ; move X/Y to min endstops, so the head is out of the way\nG90 ; Absolute positioning\nG92 E0.0 ; Reset extruder position\nM84 ; Turn steppers off\nM420 S0 ; Turn off Ditto Printing function\nM117 BIBO Print complete ; Put print complete message on screen @@ -848,6 +848,6 @@ printer_notes = Do not remove the following keywords! These keywords are used in bed_shape = -33x-93,0x-93,0x93,-33x93 #bed_model = BIBO2_bed.stl #bed_texture = BIBO2.svg -before_layer_gcode = ;BEFORE_LAYER_CHANGE\n;[layer_z]\nM104 S{temperature[0]} T0 ; set 1st nozzle heater to print temperature\n +before_layer_gcode = ;BEFORE_LAYER_CHANGE\n;[layer_z]\nM104 S{temperature[0]} T0 ; set 1st nozzle heater to print temperature\nG92 E0\n start_gcode = ;Start code PrusaSlicer BIBO 2 printers E2 only (i.e. T1)\nM420 S1 ; Turn on Ditto Printing\nG21 ; set units to metric\nG90 ; absolute positioning\nM107 ; start with the fan off\nM140 S{first_layer_bed_temperature[0] - 5} ; set bed temp\nM105 ; Report Temperatures\nM190 S{first_layer_bed_temperature[0]} ; wait for bed temp\nM104 S{first_layer_temperature[0]} T0 ; set 1st nozzle heater to ditto print temperature\nM104 S{first_layer_temperature[0]} T1 ; set 2nd nozzle heater to first layer temperature\nM105 ; Report Temperatures\nM109 S{first_layer_temperature[0]} T0 ; set 1st nozzle heater to ditto printing temperature\nM109 S{first_layer_temperature[0]} T1 ; Wait for 2nd nozzle heater to first layer temperature\nM105 ; Report Temperatures\nG28 X0 Y0 ; move X/Y to min endstops\nG28 Z0 ; move Z to min endstops\nG1 Z2 F400 ; move the print bed down 2mm\nT0 ; switch to tool position T0\nG90 ; absolute positioning\nG92 E0.0 ; zero the current extruder coordinate\nG28 ; Home all axis\nG1 Y0 F1200 E0 ; move Y to min endstop and reset extruder\nG92 E0.0 ; zero the current extruder coordinate\nT1 ; switch to tool position T1\nG92 E0.0 ; zero the current extruder coordinate\nM117 E2 nozzle wipe... ; Put Nozzle wipe message on screen, Attempt Nozzle Wipe (for ooze free startup)\nG1 X-15.0 Y-92.9 Z0.3 F2400.0 ; move to start-line position\nG1 X15.0 Y-92.9 Z0.3 F1000.0 E2 ; draw 1st line\nG1 X15.0 Y-92.6 Z0.3 F3000.0 ; move to side a little\nG1 X-15.0 Y-92.6 Z0.3 F1000.0 E4 ; draw 2nd line\nG1 X-15.0 Y-92.3 Z0.3 F3000.0 ; move to side a little\nG1 X15.0 Y-92.3 Z0.3 F1000.0 E6 ; draw 3rd line\nG1 X15.0 Y-92 Z0.3 F3000.0 ; move to side a little\nG1 X-15.0 Y-92 Z0.3 F1000.0 E8 ; draw 4th line\nG92 E0.0 ; reset extruder coordinate to zero before printing\nM117 BIBO Now Printing from E2... ; Put now printing message on screen -end_gcode = ;BIBO End GCode\nM107 ; turn fans off\nG91 ; Relative positioning\nG1 Z1 F100\nM140 S0 ; Disable heated bed\nM104 T0 S0 ; extruder T0 heater off\nM104 T1 S0 ; extruder T1 heater off\nG1 Z+0.5 X-20 Y-20 F300 ; move Z down then move print head a bit out of the way\nG28 X0 Y0 ; move X/Y to min endstops, so the head is out of the way\nG90 ; Absolute positioning\nG92 E0.0 ; Reset extruder position\nM84 ; Turn steppers off\nM420 S0 ; Turn off Ditto Printing function\nM117 BIBO Print complete ; Put print complete message on screen \ No newline at end of file +end_gcode = ;BIBO End GCode\nM107 ; turn fans off\nG91 ; Relative positioning\nG1 Z1 F100\nM140 S0 ; Disable heated bed\nM104 T0 S0 ; extruder T0 heater off\nM104 T1 S0 ; extruder T1 heater off\nG1 Z+0.5 X-20 Y-20 F300 ; move Z down then move print head a bit out of the way\nG28 X0 Y0 ; move X/Y to min endstops, so the head is out of the way\nG90 ; Absolute positioning\nG92 E0.0 ; Reset extruder position\nM84 ; Turn steppers off\nM420 S0 ; Turn off Ditto Printing function\nM117 BIBO Print complete ; Put print complete message on screen diff --git a/resources/shaders/110/printbed.fs b/resources/shaders/110/printbed.fs index 833dff08f4..e11b293e98 100644 --- a/resources/shaders/110/printbed.fs +++ b/resources/shaders/110/printbed.fs @@ -30,5 +30,7 @@ vec4 non_svg_color() void main() { - gl_FragColor = svg_source ? svg_color() : non_svg_color(); + vec4 color = svg_source ? svg_color() : non_svg_color(); + color.a = transparent_background ? color.a * 0.5 : color.a; + gl_FragColor = color; } \ No newline at end of file diff --git a/resources/shaders/140/printbed.fs b/resources/shaders/140/printbed.fs index 2f03be133a..b10aa3f988 100644 --- a/resources/shaders/140/printbed.fs +++ b/resources/shaders/140/printbed.fs @@ -32,5 +32,7 @@ vec4 non_svg_color() void main() { - out_color = svg_source ? svg_color() : non_svg_color(); + vec4 color = svg_source ? svg_color() : non_svg_color(); + color.a = transparent_background ? color.a * 0.5 : color.a; + out_color = color; } \ No newline at end of file diff --git a/resources/shaders/printbed.fs b/resources/shaders/printbed.fs index 833dff08f4..e11b293e98 100644 --- a/resources/shaders/printbed.fs +++ b/resources/shaders/printbed.fs @@ -30,5 +30,7 @@ vec4 non_svg_color() void main() { - gl_FragColor = svg_source ? svg_color() : non_svg_color(); + vec4 color = svg_source ? svg_color() : non_svg_color(); + color.a = transparent_background ? color.a * 0.5 : color.a; + gl_FragColor = color; } \ No newline at end of file diff --git a/src/slic3r/GUI/3DBed.cpp b/src/slic3r/GUI/3DBed.cpp index 5da46221fc..88119e9c4d 100644 --- a/src/slic3r/GUI/3DBed.cpp +++ b/src/slic3r/GUI/3DBed.cpp @@ -224,6 +224,7 @@ bool Bed3D::set_shape(const Pointfs& bed_shape, const double max_print_height, c m_triangles.reset(); m_gridlines.reset(); + m_contourlines.reset(); #else ExPolygon poly{ Polygon::new_scale(bed_shape) }; @@ -232,6 +233,8 @@ bool Bed3D::set_shape(const Pointfs& bed_shape, const double max_print_height, c const BoundingBox& bed_bbox = poly.contour.bounding_box(); calc_gridlines(poly, bed_bbox); + calc_contourlines(poly); + m_polygon = offset(poly.contour, (float)bed_bbox.radius() * 1.7f, jtRound, scale_(0.5)).front(); this->release_VBOs(); @@ -465,6 +468,41 @@ void Bed3D::calc_gridlines(const ExPolygon& poly, const BoundingBox& bed_bbox) } #endif // ENABLE_LEGACY_OPENGL_REMOVAL +#if ENABLE_LEGACY_OPENGL_REMOVAL +void Bed3D::init_contourlines() +{ + if (m_contourlines.is_initialized()) + return; + + if (m_contour.empty()) + return; + + const Lines contour_lines = to_lines(m_contour); + + GLModel::Geometry init_data; + init_data.format = { GLModel::Geometry::EPrimitiveType::Lines, GLModel::Geometry::EVertexLayout::P3 }; + init_data.reserve_vertices(2 * contour_lines.size()); + init_data.reserve_indices(2 * contour_lines.size()); + + for (const Slic3r::Line& l : contour_lines) { + init_data.add_vertex(Vec3f(unscale(l.a.x()), unscale(l.a.y()), GROUND_Z)); + init_data.add_vertex(Vec3f(unscale(l.b.x()), unscale(l.b.y()), GROUND_Z)); + const unsigned int vertices_counter = (unsigned int)init_data.vertices_count(); + init_data.add_line(vertices_counter - 2, vertices_counter - 1); + } + + m_contourlines.init_from(std::move(init_data)); + m_contourlines.set_color({ 1.0f, 1.0f, 1.0f, 0.5f }); +} +#else +void Bed3D::calc_contourlines(const ExPolygon& poly) +{ + const Lines contour_lines = to_lines(poly); + if (!m_contourlines.set_from_lines(contour_lines, GROUND_Z)) + BOOST_LOG_TRIVIAL(error) << "Unable to create bed contour lines\n"; +} +#endif // ENABLE_LEGACY_OPENGL_REMOVAL + // Try to match the print bed shape with the shape of an active profile. If such a match exists, // return the print bed model. std::tuple Bed3D::detect_type(const Pointfs& shape) @@ -503,6 +541,8 @@ void Bed3D::render_system(GLCanvas3D& canvas, const Transform3d& view_matrix, co if (show_texture) render_texture(bottom, canvas, view_matrix, projection_matrix); + else if (bottom) + render_contour(view_matrix, projection_matrix); } #else void Bed3D::render_system(GLCanvas3D& canvas, bool bottom, bool show_texture) @@ -512,6 +552,8 @@ void Bed3D::render_system(GLCanvas3D& canvas, bool bottom, bool show_texture) if (show_texture) render_texture(bottom, canvas); + else if (bottom) + render_contour(); } #endif // ENABLE_LEGACY_OPENGL_REMOVAL @@ -524,9 +566,9 @@ void Bed3D::render_texture(bool bottom, GLCanvas3D& canvas) if (m_texture_filename.empty()) { m_texture.reset(); #if ENABLE_LEGACY_OPENGL_REMOVAL - render_default(bottom, false, view_matrix, projection_matrix); + render_default(bottom, false, true, view_matrix, projection_matrix); #else - render_default(bottom, false); + render_default(bottom, false, true); #endif // ENABLE_LEGACY_OPENGL_REMOVAL return; } @@ -541,9 +583,9 @@ void Bed3D::render_texture(bool bottom, GLCanvas3D& canvas) // generate a temporary lower resolution texture to show while no main texture levels have been compressed if (!m_temp_texture.load_from_svg_file(m_texture_filename, false, false, false, max_tex_size / 8)) { #if ENABLE_LEGACY_OPENGL_REMOVAL - render_default(bottom, false, view_matrix, projection_matrix); + render_default(bottom, false, true, view_matrix, projection_matrix); #else - render_default(bottom, false); + render_default(bottom, false, true); #endif // ENABLE_LEGACY_OPENGL_REMOVAL return; } @@ -553,9 +595,9 @@ void Bed3D::render_texture(bool bottom, GLCanvas3D& canvas) // starts generating the main texture, compression will run asynchronously if (!m_texture.load_from_svg_file(m_texture_filename, true, true, true, max_tex_size)) { #if ENABLE_LEGACY_OPENGL_REMOVAL - render_default(bottom, false, view_matrix, projection_matrix); + render_default(bottom, false, true, view_matrix, projection_matrix); #else - render_default(bottom, false); + render_default(bottom, false, true); #endif // ENABLE_LEGACY_OPENGL_REMOVAL return; } @@ -565,9 +607,9 @@ void Bed3D::render_texture(bool bottom, GLCanvas3D& canvas) if (m_temp_texture.get_id() == 0 || m_temp_texture.get_source() != m_texture_filename) { if (!m_temp_texture.load_from_file(m_texture_filename, false, GLTexture::None, false)) { #if ENABLE_LEGACY_OPENGL_REMOVAL - render_default(bottom, false, view_matrix, projection_matrix); + render_default(bottom, false, true, view_matrix, projection_matrix); #else - render_default(bottom, false); + render_default(bottom, false, true); #endif // ENABLE_LEGACY_OPENGL_REMOVAL return; } @@ -577,18 +619,18 @@ void Bed3D::render_texture(bool bottom, GLCanvas3D& canvas) // starts generating the main texture, compression will run asynchronously if (!m_texture.load_from_file(m_texture_filename, true, GLTexture::MultiThreaded, true)) { #if ENABLE_LEGACY_OPENGL_REMOVAL - render_default(bottom, false, view_matrix, projection_matrix); + render_default(bottom, false, true, view_matrix, projection_matrix); #else - render_default(bottom, false); + render_default(bottom, false, true); #endif // ENABLE_LEGACY_OPENGL_REMOVAL return; } } else { #if ENABLE_LEGACY_OPENGL_REMOVAL - render_default(bottom, false, view_matrix, projection_matrix); + render_default(bottom, false, true, view_matrix, projection_matrix); #else - render_default(bottom, false); + render_default(bottom, false, true); #endif // ENABLE_LEGACY_OPENGL_REMOVAL return; } @@ -759,9 +801,9 @@ void Bed3D::render_custom(GLCanvas3D& canvas, bool bottom, bool show_texture, bo { if (m_texture_filename.empty() && m_model_filename.empty()) { #if ENABLE_LEGACY_OPENGL_REMOVAL - render_default(bottom, picking, view_matrix, projection_matrix); + render_default(bottom, picking, show_texture, view_matrix, projection_matrix); #else - render_default(bottom, picking); + render_default(bottom, picking, show_texture); #endif // ENABLE_LEGACY_OPENGL_REMOVAL return; } @@ -772,19 +814,23 @@ void Bed3D::render_custom(GLCanvas3D& canvas, bool bottom, bool show_texture, bo if (show_texture) render_texture(bottom, canvas, view_matrix, projection_matrix); + else if (bottom) + render_contour(view_matrix, projection_matrix); #else if (!bottom) render_model(); if (show_texture) render_texture(bottom, canvas); + else if (bottom) + render_contour(); #endif // ENABLE_LEGACY_OPENGL_REMOVAL } #if ENABLE_LEGACY_OPENGL_REMOVAL -void Bed3D::render_default(bool bottom, bool picking, const Transform3d& view_matrix, const Transform3d& projection_matrix) +void Bed3D::render_default(bool bottom, bool picking, bool show_texture, const Transform3d& view_matrix, const Transform3d& projection_matrix) #else -void Bed3D::render_default(bool bottom, bool picking) +void Bed3D::render_default(bool bottom, bool picking, bool show_texture) #endif // ENABLE_LEGACY_OPENGL_REMOVAL { m_texture.reset(); @@ -814,7 +860,7 @@ void Bed3D::render_default(bool bottom, bool picking) glsafe(::glDepthMask(GL_TRUE)); } - if (!picking) { + if (!picking && show_texture) { // draw grid #if !ENABLE_GL_CORE_PROFILE glsafe(::glLineWidth(1.5f * m_scale_factor)); @@ -822,6 +868,8 @@ void Bed3D::render_default(bool bottom, bool picking) m_gridlines.set_color(has_model && !bottom ? DEFAULT_SOLID_GRID_COLOR : DEFAULT_TRANSPARENT_GRID_COLOR); m_gridlines.render(); } + else if (!show_texture) + render_contour(view_matrix, projection_matrix); glsafe(::glDisable(GL_BLEND)); @@ -848,13 +896,15 @@ void Bed3D::render_default(bool bottom, bool picking) glsafe(::glDepthMask(GL_TRUE)); } - if (!picking) { + if (!picking && show_texture) { // draw grid glsafe(::glLineWidth(1.5f * m_scale_factor)); glsafe(::glColor4fv(has_model && !bottom ? DEFAULT_SOLID_GRID_COLOR.data() : DEFAULT_TRANSPARENT_GRID_COLOR.data())); - glsafe(::glVertexPointer(3, GL_FLOAT, m_triangles.get_vertex_data_size(), (GLvoid*)m_gridlines.get_vertices_data())); + glsafe(::glVertexPointer(3, GL_FLOAT, m_gridlines.get_vertex_data_size(), (GLvoid*)m_gridlines.get_vertices_data())); glsafe(::glDrawArrays(GL_LINES, 0, (GLsizei)m_gridlines.get_vertices_count())); } + else if (!show_texture) + render_contour(); glsafe(::glDisableClientState(GL_VERTEX_ARRAY)); @@ -863,6 +913,42 @@ void Bed3D::render_default(bool bottom, bool picking) #endif // ENABLE_LEGACY_OPENGL_REMOVAL } +#if ENABLE_LEGACY_OPENGL_REMOVAL +void Bed3D::render_contour(const Transform3d& view_matrix, const Transform3d& projection_matrix) +{ + init_contourlines(); + + GLShaderProgram* shader = wxGetApp().get_shader("flat"); + if (shader != nullptr) { + shader->start_using(); + shader->set_uniform("view_model_matrix", view_matrix); + shader->set_uniform("projection_matrix", projection_matrix); + + glsafe(::glEnable(GL_DEPTH_TEST)); + glsafe(::glEnable(GL_BLEND)); + glsafe(::glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)); + + // draw contour + glsafe(::glLineWidth(1.5f * m_scale_factor)); + m_contourlines.render(); + + glsafe(::glDisable(GL_BLEND)); + + shader->stop_using(); + } +} +#else +void Bed3D::render_contour() +{ + glsafe(::glEnableClientState(GL_VERTEX_ARRAY)); + glsafe(::glLineWidth(1.5f * m_scale_factor)); + glsafe(::glColor4f(1.0f, 1.0f, 1.0f, 0.5f)); + glsafe(::glVertexPointer(3, GL_FLOAT, m_contourlines.get_vertex_data_size(), (GLvoid*)m_contourlines.get_vertices_data())); + glsafe(::glDrawArrays(GL_LINES, 0, (GLsizei)m_contourlines.get_vertices_count())); + glsafe(::glDisableClientState(GL_VERTEX_ARRAY)); +} +#endif // ENABLE_LEGACY_OPENGL_REMOVAL + #if !ENABLE_LEGACY_OPENGL_REMOVAL void Bed3D::release_VBOs() { diff --git a/src/slic3r/GUI/3DBed.hpp b/src/slic3r/GUI/3DBed.hpp index 0ca501ba12..9cde0779ad 100644 --- a/src/slic3r/GUI/3DBed.hpp +++ b/src/slic3r/GUI/3DBed.hpp @@ -93,9 +93,11 @@ private: #if ENABLE_LEGACY_OPENGL_REMOVAL GLModel m_triangles; GLModel m_gridlines; + GLModel m_contourlines; #else GeometryBuffer m_triangles; GeometryBuffer m_gridlines; + GeometryBuffer m_contourlines; #endif // ENABLE_LEGACY_OPENGL_REMOVAL GLTexture m_texture; // temporary texture shown until the main texture has still no levels compressed @@ -153,9 +155,11 @@ private: #if ENABLE_LEGACY_OPENGL_REMOVAL void init_triangles(); void init_gridlines(); + void init_contourlines(); #else void calc_triangles(const ExPolygon& poly); void calc_gridlines(const ExPolygon& poly, const BoundingBox& bed_bbox); + void calc_contourlines(const ExPolygon& poly); #endif // ENABLE_LEGACY_OPENGL_REMOVAL static std::tuple detect_type(const Pointfs& shape); #if ENABLE_LEGACY_OPENGL_REMOVAL @@ -171,13 +175,15 @@ private: void render_texture(bool bottom, GLCanvas3D& canvas, const Transform3d& view_matrix, const Transform3d& projection_matrix); void render_model(const Transform3d& view_matrix, const Transform3d& projection_matrix); void render_custom(GLCanvas3D& canvas, const Transform3d& view_matrix, const Transform3d& projection_matrix, bool bottom, bool show_texture, bool picking); - void render_default(bool bottom, bool picking, const Transform3d& view_matrix, const Transform3d& projection_matrix); + void render_default(bool bottom, bool picking, bool show_texture, const Transform3d& view_matrix, const Transform3d& projection_matrix); + void render_contour(const Transform3d& view_matrix, const Transform3d& projection_matrix); #else void render_system(GLCanvas3D& canvas, bool bottom, bool show_texture); void render_texture(bool bottom, GLCanvas3D& canvas); void render_model(); void render_custom(GLCanvas3D& canvas, bool bottom, bool show_texture, bool picking); - void render_default(bool bottom, bool picking); + void render_default(bool bottom, bool picking, bool show_texture); + void render_contour(); void release_VBOs(); #endif // ENABLE_LEGACY_OPENGL_REMOVAL diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 4af648aa0f..234f067511 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -1668,6 +1668,9 @@ void GLCanvas3D::render() #if ENABLE_RENDER_PICKING_PASS if (!m_picking_enabled || !m_show_picking_texture) { #endif // ENABLE_RENDER_PICKING_PASS + + const bool is_looking_downward = camera.is_looking_downward(); + // draw scene glsafe(::glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)); _render_background(); @@ -1677,12 +1680,13 @@ void GLCanvas3D::render() _render_gcode(); _render_sla_slices(); _render_selection(); + if (is_looking_downward) #if ENABLE_LEGACY_OPENGL_REMOVAL - _render_bed(camera.get_view_matrix(), camera.get_projection_matrix(), !camera.is_looking_downward(), true); + _render_bed(camera.get_view_matrix(), camera.get_projection_matrix(), false, true); #else - _render_bed(!camera.is_looking_downward(), true); + _render_bed(false, true); #endif // ENABLE_LEGACY_OPENGL_REMOVAL - _render_objects(GLVolumeCollection::ERenderType::Transparent); + _render_objects(GLVolumeCollection::ERenderType::Transparent); _render_sequential_clearance(); #if ENABLE_RENDER_SELECTION_CENTER @@ -1703,6 +1707,12 @@ void GLCanvas3D::render() // could be invalidated by the following gizmo render methods _render_selection_sidebar_hints(); _render_current_gizmo(); + if (!is_looking_downward) +#if ENABLE_LEGACY_OPENGL_REMOVAL + _render_bed(camera.get_view_matrix(), camera.get_projection_matrix(), true, true); +#else + _render_bed(true, true); +#endif // ENABLE_LEGACY_OPENGL_REMOVAL #if ENABLE_RENDER_PICKING_PASS } #endif // ENABLE_RENDER_PICKING_PASS