From 0726624a869d141a0aebe68d30ecdd96342f79a9 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 24 Sep 2007 09:35:59 +0000 Subject: [PATCH] From Jose Delport: "have been using the new VIEW_DEPENDENT_WITH_ORTHOGRAPHIC_OVERLAY mode of the OverlayNode. I change the overlay subgraph dynamically and when I remove all the subgraph nodes that is inside the current main camera FOV (others outside still exist), the overlay texture does not update because of the early return in the traversal. I then get a kind of ghost texture moving around the terrain. The attached file fixed the problem for me, but I'm not sure if it is the best way to address the problem." --- src/osgSim/OverlayNode.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/osgSim/OverlayNode.cpp b/src/osgSim/OverlayNode.cpp index 07bb4d01c..f3b73ee44 100644 --- a/src/osgSim/OverlayNode.cpp +++ b/src/osgSim/OverlayNode.cpp @@ -1501,8 +1501,14 @@ void OverlayNode::traverse_VIEW_DEPENDENT_WITH_ORTHOGRAPHIC_OVERLAY(osg::NodeVis #else overlayPolytope.computeSilhoette(lookVector, corners); #endif - if (corners.empty()) return; - + if (corners.empty()) + { + camera->setClearColor(_overlayClearColor); + //camera->setStateSet(overlayData._overlayStateSet.get()); + camera->accept(*cv); + return; + } + if (overlayData._geode.valid()) { overlayData._geode->addDrawable(overlayPolytope.createDrawable(osg::Vec4d(1.0f,1.0f,1.0f,1.0f)));