Fix color blending of preview shells (#2799)

This commit is contained in:
Noisyfox 2023-11-19 22:20:42 +08:00 committed by GitHub
parent 50a9345ddd
commit 70d86af253
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1242,8 +1242,8 @@ void GCodeViewer::render(int canvas_width, int canvas_height, int right_margin)
return;
glsafe(::glEnable(GL_DEPTH_TEST));
render_toolpaths();
render_shells();
render_toolpaths();
float legend_height = 0.0f;
render_legend(legend_height, canvas_width, canvas_height, right_margin);
@ -4033,7 +4033,7 @@ void GCodeViewer::render_shells()
if (shader == nullptr)
return;
// glsafe(::glDepthMask(GL_FALSE));
glsafe(::glDepthMask(GL_FALSE));
shader->start_using();
shader->set_uniform("emission_factor", 0.1f);
@ -4042,7 +4042,7 @@ void GCodeViewer::render_shells()
shader->set_uniform("emission_factor", 0.0f);
shader->stop_using();
// glsafe(::glDepthMask(GL_TRUE));
glsafe(::glDepthMask(GL_TRUE));
}
//BBS