#7076 - Modifiers and similar objects always rendered as transparent

This commit is contained in:
enricoturri1966 2021-10-08 10:48:46 +02:00
parent ce397a0c5c
commit b9ac80ccd4
4 changed files with 39 additions and 0 deletions

View file

@ -464,9 +464,15 @@ std::array<float, 4> color_from_model_volume(const ModelVolume& model_volume)
color[2] = 0.2f;
}
else if (model_volume.is_modifier()) {
#if ENABLE_MODIFIERS_ALWAYS_TRANSPARENT
color[0] = 1.0f;
color[1] = 1.0f;
color[2] = 0.2f;
#else
color[0] = 0.2f;
color[1] = 1.0f;
color[2] = 0.2f;
#endif // ENABLE_MODIFIERS_ALWAYS_TRANSPARENT
}
else if (model_volume.is_support_blocker()) {
color[0] = 1.0f;
@ -836,7 +842,15 @@ void GLVolumeCollection::render(GLVolumeCollection::ERenderType type, bool disab
glsafe(::glDisable(GL_CULL_FACE));
for (GLVolumeWithIdAndZ& volume : to_render) {
#if ENABLE_MODIFIERS_ALWAYS_TRANSPARENT
if (type == ERenderType::Transparent)
volume.first->force_transparent = true;
#endif // ENABLE_MODIFIERS_ALWAYS_TRANSPARENT
volume.first->set_render_color();
#if ENABLE_MODIFIERS_ALWAYS_TRANSPARENT
if (type == ERenderType::Transparent)
volume.first->force_transparent = false;
#endif // ENABLE_MODIFIERS_ALWAYS_TRANSPARENT
// render sinking contours of non-hovered volumes
if (m_show_sinking_contours)