From 6958972a5227c800322cf972787983c899bbb798 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 8 Mar 2015 19:12:31 +0100 Subject: [PATCH] set cache context when off-screen rendering --- src/Gui/View3DInventorViewer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Gui/View3DInventorViewer.cpp b/src/Gui/View3DInventorViewer.cpp index e970d84e6b..2d6d532f15 100644 --- a/src/Gui/View3DInventorViewer.cpp +++ b/src/Gui/View3DInventorViewer.cpp @@ -1246,6 +1246,10 @@ void View3DInventorViewer::renderToFramebuffer(QGLFramebufferObject* fbo) glDepthRange(0.1,1.0); SoGLRenderAction gl(SbViewportRegion(width, height)); + // When creating a new GL render action we have to copy over the cache context id + // For further details see init(). + uint32_t id = this->getSoRenderManager()->getGLRenderAction()->getCacheContext(); + gl.setCacheContext(id); gl.setTransparencyType(SoGLRenderAction::SORTED_OBJECT_SORTED_TRIANGLE_BLEND); gl.apply(this->backgroundroot); gl.apply(this->getSoRenderManager()->getSceneGraph());