Skip to content

Commit

Permalink
ENH:improve brightness for the slice of black model
Browse files Browse the repository at this point in the history
Jira: STUDIO-3992
Change-Id: If4134a5fa4bd1620a550f9c2fca2b6e2d7207f06
  • Loading branch information
Haidiye00 authored and lanewei120 committed Nov 9, 2023
1 parent 83f4859 commit 4a5bca2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/slic3r/GUI/3DScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ std::vector<std::array<float, 4>> get_extruders_colors()
}
float FullyTransparentMaterialThreshold = 0.1f;
float FullTransparentModdifiedToFixAlpha = 0.3f;
const float BlackThreshold = 0.2f;
std::array<float, 4> adjust_color_for_rendering(const std::array<float, 4> &colors)
{
if (colors[3] < FullyTransparentMaterialThreshold) { // completely transparent
Expand All @@ -99,11 +100,11 @@ std::array<float, 4> adjust_color_for_rendering(const std::array<float, 4> &colo
new_color[3] = FullTransparentModdifiedToFixAlpha;
return new_color;
}
else if ((colors[0] < 0.1) && (colors[1] < 0.1) && (colors[2] < 0.1)) {//black filament deal
else if ((colors[0] < BlackThreshold) && (colors[1] < BlackThreshold) && (colors[2] < BlackThreshold)) { // black filament deal
std::array<float, 4> new_color;
new_color[0] = 0.1;
new_color[1] = 0.1;
new_color[2] = 0.1;
new_color[0] = BlackThreshold;
new_color[1] = BlackThreshold;
new_color[2] = BlackThreshold;
new_color[3] = colors[3];
return new_color;
}
Expand Down

0 comments on commit 4a5bca2

Please sign in to comment.