diff --git a/src/Gui/DlgSettings3DView.ui b/src/Gui/DlgSettings3DView.ui
index 07024daf4e..25c45f3814 100644
--- a/src/Gui/DlgSettings3DView.ui
+++ b/src/Gui/DlgSettings3DView.ui
@@ -214,6 +214,45 @@ but slower response to any scene changes.
-
+
+
+
+
+
+ Transparent objects:
+
+
+
+ -
+
+
+
+ 120
+ 0
+
+
+
+ Render types of transparent objects
+
+
+ TransparentObjectRenderType
+
+
+ View
+
+
-
+
+ One pass
+
+
+ -
+
+ Backface pass
+
+
+
+
+ -
@@ -223,7 +262,7 @@ but slower response to any scene changes.
- -
+
-
@@ -236,14 +275,14 @@ but slower response to any scene changes.
- -
+
-
Eye to eye distance for stereo modes
- -
+
-
@@ -279,7 +318,7 @@ bounding box size of the 3D object that is currently displayed.
- -
+
-
Backlight is enabled with the defined color
@@ -295,7 +334,7 @@ bounding box size of the 3D object that is currently displayed.
- -
+
-
false
@@ -318,7 +357,7 @@ bounding box size of the 3D object that is currently displayed.
- -
+
-
Qt::Horizontal
@@ -331,7 +370,7 @@ bounding box size of the 3D object that is currently displayed.
- -
+
-
false
@@ -347,7 +386,7 @@ bounding box size of the 3D object that is currently displayed.
- -
+
-
false
diff --git a/src/Gui/DlgSettings3DViewImp.cpp b/src/Gui/DlgSettings3DViewImp.cpp
index 6365e0e547..90db0ba8ce 100644
--- a/src/Gui/DlgSettings3DViewImp.cpp
+++ b/src/Gui/DlgSettings3DViewImp.cpp
@@ -83,6 +83,8 @@ void DlgSettings3DViewImp::saveSettings()
index = ui->renderCache->currentIndex();
hGrp->SetInt("RenderCache", index);
+ ui->comboTransparentRender->onSave();
+
QVariant const &vBoxMarkerSize = ui->boxMarkerSize->itemData(ui->boxMarkerSize->currentIndex());
hGrp->SetInt("MarkerSize", vBoxMarkerSize.toInt());
@@ -124,6 +126,8 @@ void DlgSettings3DViewImp::loadSettings()
index = hGrp->GetInt("RenderCache", 0);
ui->renderCache->setCurrentIndex(index);
+ ui->comboTransparentRender->onRestore();
+
int const current = hGrp->GetInt("MarkerSize", 9L);
ui->boxMarkerSize->addItem(tr("5px"), QVariant(5));
ui->boxMarkerSize->addItem(tr("7px"), QVariant(7));
diff --git a/src/Gui/View3DInventor.cpp b/src/Gui/View3DInventor.cpp
index b0228fe3c1..71c3608b4a 100644
--- a/src/Gui/View3DInventor.cpp
+++ b/src/Gui/View3DInventor.cpp
@@ -189,6 +189,7 @@ View3DInventor::View3DInventor(Gui::Document* pcDocument, QWidget* parent,
OnChange(*hGrp,"Dimensions3dVisible");
OnChange(*hGrp,"DimensionsDeltaVisible");
OnChange(*hGrp,"PickRadius");
+ OnChange(*hGrp,"TransparentObjectRenderType");
stopSpinTimer = new QTimer(this);
connect(stopSpinTimer, SIGNAL(timeout()), this, SLOT(stopAnimating()));
@@ -414,6 +415,17 @@ void View3DInventor::OnChange(ParameterGrp::SubjectType &rCaller,ParameterGrp::M
else if (strcmp(Reason, "PickRadius") == 0) {
_viewer->setPickRadius(rGrp.GetFloat("PickRadius", 5.0f));
}
+ else if (strcmp(Reason, "TransparentObjectRenderType") == 0) {
+ long renderType = rGrp.GetInt("TransparentObjectRenderType", 0);
+ if (renderType == 0) {
+ _viewer->getSoRenderManager()->getGLRenderAction()
+ ->setTransparentDelayedObjectRenderType(SoGLRenderAction::ONE_PASS);
+ }
+ else if (renderType == 1) {
+ _viewer->getSoRenderManager()->getGLRenderAction()
+ ->setTransparentDelayedObjectRenderType(SoGLRenderAction::NONSOLID_SEPARATE_BACKFACE_PASS);
+ }
+ }
else {
unsigned long col1 = rGrp.GetUnsigned("BackgroundColor",3940932863UL);
unsigned long col2 = rGrp.GetUnsigned("BackgroundColor2",859006463UL); // default color (dark blue)