mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-19 20:57:53 -06:00
FIX: Opaque display after completed slicing
Change-Id: I944f5063ba41b767d01a26052e23bd803425b081 (cherry picked from commit f4d5ef5814c50d8477ac21e58182b00dbb20d6c8)
This commit is contained in:
parent
c7ed4e7e14
commit
eca3d311d7
5 changed files with 7 additions and 38 deletions
|
@ -89,29 +89,16 @@ std::vector<std::array<float, 4>> get_extruders_colors()
|
|||
}
|
||||
float FullyTransparentMaterialThreshold = 0.1f;
|
||||
float FullTransparentModdifiedToFixAlpha = 0.3f;
|
||||
std::array<float, 4> adjust_color_for_rendering(const std::array<float, 4> &colors, int whichView)
|
||||
std::array<float, 4> adjust_color_for_rendering(const std::array<float, 4> &colors)
|
||||
{
|
||||
if (whichView == (int) Slic3r::GUI::GLCanvas3D::ECanvasType::CanvasView3D ||
|
||||
whichView == (int) Slic3r::GUI::GLCanvas3D::ECanvasType::CanvasAssembleView) {
|
||||
if (colors[3] < FullyTransparentMaterialThreshold) { // completely transparent
|
||||
if (colors[3] < FullyTransparentMaterialThreshold) { // completely transparent
|
||||
std::array<float, 4> new_color;
|
||||
new_color[0] = 1;
|
||||
new_color[1] = 1;
|
||||
new_color[2] = 1;
|
||||
new_color[3] = FullTransparentModdifiedToFixAlpha;
|
||||
return new_color;
|
||||
}
|
||||
} else {
|
||||
if (colors[3] < FullyTransparentMaterialThreshold) { // completely transparent
|
||||
std::array<float, 4> new_color;
|
||||
new_color[0] = 1;
|
||||
new_color[1] = 1;
|
||||
new_color[2] = 1;
|
||||
new_color[3] = 0.05f;
|
||||
return new_color;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return colors;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue