]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Prevent VTK view becoming transparent when rendering transparent objects, when using...
authorViktor UZLOV <vuzlov@salomex.nnov.opencascade.com>
Wed, 5 May 2021 14:00:10 +0000 (17:00 +0300)
committervsr <vsr@opencascade.com>
Wed, 5 May 2021 14:47:14 +0000 (17:47 +0300)
src/SVTK/SVTK_ViewWindow.cxx

index 67fccd08850c5fb0df3c1792a9bc612a695e30a7..bc5c845503317ddbc40a7a0848427a9fa5b2a99f 100644 (file)
 #include <GL/gl.h>
 #endif
 
+// Use workaround for rendering transparent object over MESA
+#defing USE_WORKAROUND_FOR_MESA
+
 namespace SVTK
 {
   int convertAction( const int accelAction )
@@ -251,6 +254,11 @@ void SVTK_ViewWindow::Initialize(SVTK_ViewModelBase* theModel)
   myKeyFreeInteractorStyle->AddObserver(SVTK::OperationFinished,
                                         myEventCallbackCommand.GetPointer(), 0.0);
 
+#ifdef USE_WORKAROUND_FOR_MESA
+  char *mesavar = getenv("SALOME_USE_MESA");
+  if (mesavar)
+    getRenderer()->SetUseDepthPeeling(1);
+#endif //USE_WORKAROUND_FOR_MESA
 
   getRenderer()->SetBackgroundAlpha(1.0);
   myInteractor->getRenderWindow()->SetMultiSamples(0);