diff --git a/resources/shaders/options_120_flat.fs b/resources/shaders/options_120.fs similarity index 100% rename from resources/shaders/options_120_flat.fs rename to resources/shaders/options_120.fs diff --git a/resources/shaders/options_120_flat.vs b/resources/shaders/options_120.vs similarity index 100% rename from resources/shaders/options_120_flat.vs rename to resources/shaders/options_120.vs diff --git a/resources/shaders/toolpaths.fs b/resources/shaders/toolpaths_lines.fs similarity index 100% rename from resources/shaders/toolpaths.fs rename to resources/shaders/toolpaths_lines.fs diff --git a/resources/shaders/toolpaths.vs b/resources/shaders/toolpaths_lines.vs similarity index 100% rename from resources/shaders/toolpaths.vs rename to resources/shaders/toolpaths_lines.vs diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index 80a5e15ed..bcb4a0a26 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -606,8 +606,7 @@ void GCodeViewer::export_toolpaths_to_obj(const char* filename) const fprintf(fp, "# Generated by %s based on Slic3r\n", SLIC3R_BUILD_ID); unsigned int colors_count = 1; - for (const Color& color : colors) - { + for (const Color& color : colors) { fprintf(fp, "\nnewmtl material_%d\n", colors_count++); fprintf(fp, "Ka 1 1 1\n"); fprintf(fp, "Kd %f %f %f\n", color[0], color[1], color[2]); @@ -858,14 +857,14 @@ void GCodeViewer::init_shaders() for (unsigned char i = begin_id; i < end_id; ++i) { switch (buffer_type(i)) { - case EMoveType::Tool_change: { m_buffers[i].shader = is_glsl_120 ? "options_120_flat" : "options_110"; break; } - case EMoveType::Color_change: { m_buffers[i].shader = is_glsl_120 ? "options_120_flat" : "options_110"; break; } - case EMoveType::Pause_Print: { m_buffers[i].shader = is_glsl_120 ? "options_120_flat" : "options_110"; break; } - case EMoveType::Custom_GCode: { m_buffers[i].shader = is_glsl_120 ? "options_120_flat" : "options_110"; break; } - case EMoveType::Retract: { m_buffers[i].shader = is_glsl_120 ? "options_120_flat" : "options_110"; break; } - case EMoveType::Unretract: { m_buffers[i].shader = is_glsl_120 ? "options_120_flat" : "options_110"; break; } - case EMoveType::Extrude: { m_buffers[i].shader = "toolpaths"; break; } - case EMoveType::Travel: { m_buffers[i].shader = "toolpaths"; break; } + case EMoveType::Tool_change: { m_buffers[i].shader = is_glsl_120 ? "options_120" : "options_110"; break; } + case EMoveType::Color_change: { m_buffers[i].shader = is_glsl_120 ? "options_120" : "options_110"; break; } + case EMoveType::Pause_Print: { m_buffers[i].shader = is_glsl_120 ? "options_120" : "options_110"; break; } + case EMoveType::Custom_GCode: { m_buffers[i].shader = is_glsl_120 ? "options_120" : "options_110"; break; } + case EMoveType::Retract: { m_buffers[i].shader = is_glsl_120 ? "options_120" : "options_110"; break; } + case EMoveType::Unretract: { m_buffers[i].shader = is_glsl_120 ? "options_120" : "options_110"; break; } + case EMoveType::Extrude: { m_buffers[i].shader = "toolpaths_lines"; break; } + case EMoveType::Travel: { m_buffers[i].shader = "toolpaths_lines"; break; } default: { break; } } } @@ -1463,8 +1462,8 @@ void GCodeViewer::render_legend() const else draw_list->AddCircleFilled(center, 0.5f * icon_size, ImGui::GetColorU32({ color[0], color[1], color[2], 1.0f }), 16); #else - ImVec2 center(0.5f * (pos.x + pos.x + icon_size), 0.5f * (pos.y + pos.y + icon_size)); - if (m_buffers[buffer_id(EMoveType::Retract)].shader == "options_120_flat") { + ImVec2 center(0.5f * (pos.x + pos.x + icon_size), 0.5f * (pos.y + pos.y + icon_size)); + if (m_buffers[buffer_id(EMoveType::Retract)].shader == "options_120") { draw_list->AddCircleFilled(center, 0.5f * icon_size, ImGui::GetColorU32({ 0.5f * color[0], 0.5f * color[1], 0.5f * color[2], 1.0f }), 16); float radius = 0.5f * icon_size; @@ -2527,7 +2526,7 @@ void GCodeViewer::render_shaders_editor() const switch (m_shaders_editor.points.shader_version) { case 0: { set_shader("options_110"); break; } - case 1: { set_shader("options_120_flat"); break; } + case 1: { set_shader("options_120"); break; } } if (ImGui::TreeNode("Options")) { diff --git a/src/slic3r/GUI/GCodeViewer.hpp b/src/slic3r/GUI/GCodeViewer.hpp index 0be17f790..e6c3e26ea 100644 --- a/src/slic3r/GUI/GCodeViewer.hpp +++ b/src/slic3r/GUI/GCodeViewer.hpp @@ -65,7 +65,7 @@ class GCodeViewer void reset(); }; - // ibo buffer containing indices data (triangles) used to render a specific toolpath type + // ibo buffer containing indices data (lines/triangles) used to render a specific toolpath type struct IBuffer { // ibo id diff --git a/src/slic3r/GUI/GLShadersManager.cpp b/src/slic3r/GUI/GLShadersManager.cpp index 5f726d4ef..6baf46f6b 100644 --- a/src/slic3r/GUI/GLShadersManager.cpp +++ b/src/slic3r/GUI/GLShadersManager.cpp @@ -36,9 +36,9 @@ std::pair GLShadersManager::init() // used to render options in gcode preview valid &= append_shader("options_110", { "options_110.vs", "options_110.fs" }); if (GUI::wxGetApp().is_glsl_version_greater_or_equal_to(1, 20)) - valid &= append_shader("options_120_flat", { "options_120_flat.vs", "options_120_flat.fs" }); + valid &= append_shader("options_120", { "options_120.vs", "options_120.fs" }); // used to render extrusion and travel paths in gcode preview - valid &= append_shader("toolpaths", { "toolpaths.vs", "toolpaths.fs" }); + valid &= append_shader("toolpaths_lines", { "toolpaths_lines.vs", "toolpaths_lines.fs" }); // used to render objects in 3d editor valid &= append_shader("gouraud", { "gouraud.vs", "gouraud.fs" }); // used to render variable layers heights in 3d editor