From 4a5bca24023e2e2e0a1d612dc5305f684a5e8d39 Mon Sep 17 00:00:00 2001 From: "zhou.xu" Date: Tue, 31 Oct 2023 17:13:00 +0800 Subject: [PATCH] ENH:improve brightness for the slice of black model Jira: STUDIO-3992 Change-Id: If4134a5fa4bd1620a550f9c2fca2b6e2d7207f06 --- src/slic3r/GUI/3DScene.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/slic3r/GUI/3DScene.cpp b/src/slic3r/GUI/3DScene.cpp index 862a2f3856..819392422e 100644 --- a/src/slic3r/GUI/3DScene.cpp +++ b/src/slic3r/GUI/3DScene.cpp @@ -89,6 +89,7 @@ std::vector> get_extruders_colors() } float FullyTransparentMaterialThreshold = 0.1f; float FullTransparentModdifiedToFixAlpha = 0.3f; +const float BlackThreshold = 0.2f; std::array adjust_color_for_rendering(const std::array &colors) { if (colors[3] < FullyTransparentMaterialThreshold) { // completely transparent @@ -99,11 +100,11 @@ std::array adjust_color_for_rendering(const std::array &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 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; }