Fix preview shell transparency

This commit is contained in:
Noisyfox 2023-10-27 14:24:08 +08:00
parent 0d27e084f3
commit a50c5a2b7a
2 changed files with 8 additions and 2 deletions

View file

@ -458,7 +458,7 @@ void GLVolume::render_with_outline(const Transform3d &view_model_matrix)
}
//BBS add render for simple case
void GLVolume::simple_render(GLShaderProgram* shader, ModelObjectPtrs& model_objects, std::vector<ColorRGBA>& extruder_colors)
void GLVolume::simple_render(GLShaderProgram* shader, ModelObjectPtrs& model_objects, std::vector<ColorRGBA> extruder_colors)
{
if (this->is_left_handed())
glFrontFace(GL_CW);
@ -493,6 +493,12 @@ void GLVolume::simple_render(GLShaderProgram* shader, ModelObjectPtrs& model_obj
} while (0);
if (color_volume && !picking) {
// when force_transparent, we need to keep the alpha
if (force_native_color && render_color.is_transparent()) {
for (auto &extruder_color : extruder_colors)
extruder_color.a(render_color.a());
}
for (int idx = 0; idx < mmuseg_models.size(); idx++) {
GUI::GLModel &m = mmuseg_models[idx];
if (!m.is_initialized())

View file

@ -320,7 +320,7 @@ public:
virtual void render_with_outline(const Transform3d &view_model_matrix);
//BBS: add simple render function for thumbnail
void simple_render(GLShaderProgram* shader, ModelObjectPtrs& model_objects, std::vector<ColorRGBA>& extruder_colors);
void simple_render(GLShaderProgram* shader, ModelObjectPtrs& model_objects, std::vector<ColorRGBA> extruder_colors);
void set_bounding_boxes_as_dirty() {
m_transformed_bounding_box.reset();