Gui: fix screenshot

This commit is contained in:
Zheng, Lei
2020-01-10 10:10:23 +08:00
committed by wmayer
parent a46e3b3734
commit 20c85d9cc4
2 changed files with 10 additions and 1 deletions

View File

@@ -617,6 +617,15 @@ void SoBrepFaceSet::GLRender(SoGLRenderAction *action)
// material override with transparncy won't work.
mb.sendFirst();
if(SoShapeStyleElement::get(state)->getFlags()
& (SoShapeStyleElement::TRANSP_TEXTURE|SoShapeStyleElement::TRANSP_MATERIAL))
{
// For some reason, there is an inconsistence in blending state between
// OpenGL and Coin, especially when doing offscreen rendering.
if(!glIsEnabled(GL_BLEND))
glEnable(GL_BLEND);
}
// When setting transparency shouldGLRender() handles the rendering and returns false.
// Therefore generatePrimitives() needs to be re-implemented to handle the materials
// correctly.