From 7895134432fd33c608971871a12008b82277f51e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Tr=C3=B6ger?= Date: Mon, 5 Jan 2015 11:20:28 +0100 Subject: [PATCH] + Assign the correct context id to the new render action so that correct VBOs are used --- src/Gui/View3DInventorViewer.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Gui/View3DInventorViewer.cpp b/src/Gui/View3DInventorViewer.cpp index 76ec7d92a..e970d84e6 100644 --- a/src/Gui/View3DInventorViewer.cpp +++ b/src/Gui/View3DInventorViewer.cpp @@ -422,7 +422,16 @@ void View3DInventorViewer::init() // Set our own render action which show a bounding box if // the SoFCSelection::BOX style is set + // + // Important note: + // When creating a new GL render action we have to copy over the cache context id + // because otherwise we may get strange rendering behaviour. For more details see + // http://forum.freecadweb.org/viewtopic.php?f=10&t=7486&start=120#p74398 and for + // the fix and some details what happens behind the scene have a look at this + // http://forum.freecadweb.org/viewtopic.php?f=10&t=7486&p=74777#p74736 + uint32_t id = this->getSoRenderManager()->getGLRenderAction()->getCacheContext(); this->getSoRenderManager()->setGLRenderAction(new SoBoxSelectionRenderAction); + this->getSoRenderManager()->getGLRenderAction()->setCacheContext(id); // set the transperency and antialiasing settings // getGLRenderAction()->setTransparencyType(SoGLRenderAction::SORTED_OBJECT_BLEND);