FIX: render the opaque shell to the transparent shell

alpha channel is not need to update in shell

Change-Id: I4ad3caa7d40f69ec799f1076cf617805ba1a240b
(cherry picked from commit 315605926764121f6d0ccedf0e88a1ffc3aa0b46)
This commit is contained in:
zhou.xu 2023-06-12 11:11:36 +08:00 committed by Lane.Wei
parent ca81c370fd
commit cc447bf122
3 changed files with 10 additions and 4 deletions

View file

@ -1533,7 +1533,7 @@ void GLVolumeCollection::reset_outside_state()
}
}
void GLVolumeCollection::update_colors_by_extruder(const DynamicPrintConfig* config)
void GLVolumeCollection::update_colors_by_extruder(const DynamicPrintConfig *config, bool is_update_alpha)
{
static const float inv_255 = 1.0f / 255.0f;
@ -1603,7 +1603,13 @@ void GLVolumeCollection::update_colors_by_extruder(const DynamicPrintConfig* con
const Color& color = colors[extruder_id];
if (!color.text.empty()) {
for (int i = 0; i < 4; ++i) {
volume->color[i] = (float)color.rgba[i] * inv_255;
if (is_update_alpha == false) {
if (i < 3) {
volume->color[i] = (float) color.rgba[i] * inv_255;
}
continue;
}
volume->color[i] = (float) color.rgba[i] * inv_255;
}
}
}