From d7bb4c36f58dfb46834919a6625ea7637f374954 Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Wed, 1 Sep 2021 09:34:07 +0200 Subject: [PATCH 1/2] Requires OpenGL 3.3 as a minimum to enable instanced rendering of seams and other options in preview --- src/slic3r/GUI/GCodeViewer.cpp | 2 +- src/slic3r/GUI/GLShadersManager.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index 732403b03..ad2e6e973 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -807,7 +807,7 @@ void GCodeViewer::render() case EMoveType::Unretract: case EMoveType::Seam: { #if ENABLE_SEAMS_USING_MODELS - if (wxGetApp().is_gl_version_greater_or_equal_to(3, 1)) { + if (wxGetApp().is_gl_version_greater_or_equal_to(3, 3)) { buffer.render_primitive_type = TBuffer::ERenderPrimitiveType::Model; buffer.shader = "gouraud_light_instanced"; buffer.model.model.init_from(diamond(16)); diff --git a/src/slic3r/GUI/GLShadersManager.cpp b/src/slic3r/GUI/GLShadersManager.cpp index c93f22f46..edbe2bb46 100644 --- a/src/slic3r/GUI/GLShadersManager.cpp +++ b/src/slic3r/GUI/GLShadersManager.cpp @@ -39,7 +39,7 @@ std::pair GLShadersManager::init() valid &= append_shader("printbed", { "printbed.vs", "printbed.fs" }); // used to render options in gcode preview #if ENABLE_SEAMS_USING_MODELS - if (GUI::wxGetApp().is_gl_version_greater_or_equal_to(3, 1)) + if (GUI::wxGetApp().is_gl_version_greater_or_equal_to(3, 3)) valid &= append_shader("gouraud_light_instanced", { "gouraud_light_instanced.vs", "gouraud_light_instanced.fs" }); else { #endif // ENABLE_SEAMS_USING_MODELS From 95c05aae3bb85b9da51e466578a0061c23e7881d Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Wed, 1 Sep 2021 09:54:59 +0200 Subject: [PATCH 2/2] Fixed typo which broke export of toolpaths to obj file --- src/slic3r/GUI/GCodeViewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index ad2e6e973..e6e391d37 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -1100,7 +1100,7 @@ void GCodeViewer::export_toolpaths_to_obj(const char* filename) const // save vertices to file fprintf(fp, "\n# vertices\n"); for (const Vec3f& v : out_vertices) { - fprintf(fp, "v %g %g %g\n", v.x(), v.y(), v.x()); + fprintf(fp, "v %g %g %g\n", v.x(), v.y(), v.z()); } // save normals to file