Tech ENABLE_GL_CORE_PROFILE - Thick lines shader enhanced to render dashed lines

Fixed conflicts while rebase with master
This commit is contained in:
enricoturri1966 2022-03-25 14:33:11 +01:00
parent 94305e5912
commit 914a66e2c3
17 changed files with 169 additions and 27 deletions
src/slic3r/GUI

View file

@ -736,7 +736,7 @@ void GCodeViewer::init()
#if ENABLE_GL_SHADERS_ATTRIBUTES
buffer.vertices.format = VBuffer::EFormat::Position;
#if ENABLE_GL_CORE_PROFILE
buffer.shader = "thick_lines";
buffer.shader = "dashed_thick_lines";
#else
buffer.shader = "flat";
#endif // ENABLE_GL_CORE_PROFILE
@ -3026,6 +3026,7 @@ void GCodeViewer::render_toolpaths()
const double zoom = camera.get_zoom();
shader.set_uniform("viewport_size", Vec2d(double(viewport[2]), double(viewport[3])));
shader.set_uniform("width", (zoom < 5.0) ? 1.0 : (1.0 + 5.0 * (zoom - 5.0) / (100.0 - 5.0)));
shader.set_uniform("gap_size", 0.0f);
#endif // ENABLE_GL_CORE_PROFILE
glsafe(::glMultiDrawElements(GL_LINES, (const GLsizei*)path.sizes.data(), GL_UNSIGNED_SHORT, (const void* const*)path.offsets.data(), (GLsizei)path.sizes.size()));