mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-07 23:17:35 -06:00
Add a simple subtle outline effect by drawing back faces using wireframe mode (#2934)
* Add a simple subtle outline effect by drawing back faces using wireframe mode * Show outline in white if the model color is too dark * Make the outline algorithm more reliable * Enable cull face, which fix render on Linux * Fix `disable_cullface`
This commit is contained in:
parent
2745575dd2
commit
0cee513416
4 changed files with 46 additions and 8 deletions
|
@ -1247,6 +1247,7 @@ void GCodeViewer::render(int canvas_width, int canvas_height, int right_margin)
|
|||
|
||||
glsafe(::glEnable(GL_DEPTH_TEST));
|
||||
render_shells();
|
||||
glsafe(::glClear(GL_DEPTH_BUFFER_BIT)); // This makes sure toolpaths are on top of shells
|
||||
render_toolpaths();
|
||||
float legend_height = 0.0f;
|
||||
render_legend(legend_height, canvas_width, canvas_height, right_margin);
|
||||
|
@ -4030,7 +4031,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);
|
||||
|
@ -4039,7 +4040,7 @@ void GCodeViewer::render_shells()
|
|||
shader->set_uniform("emission_factor", 0.0f);
|
||||
shader->stop_using();
|
||||
|
||||
glsafe(::glDepthMask(GL_TRUE));
|
||||
//glsafe(::glDepthMask(GL_TRUE));
|
||||
}
|
||||
|
||||
//BBS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue