Hi Laurens, I've tried to understand what you think might a bug several times, looking at the CullingSet/CullingStack and CullVisitor code, as well as testing your model but still can't grasp what is thought to be wrong. A _resultMask that is not modified should be safe to push and pop as it shouldn't change anything. You suggested changes are awkward, to me if there is a bug in the management of _resultMask then pushing workarounds into CullVisitor is not the way to solve it.
Robert. On 25 January 2013 14:54, Laurens Voerman <[email protected]> wrote: > Hi Robert, > > attached in CullVisitor.zip is an update for src/osgUtil/CullVisitor.cpp > (based on svn rev 13311 - 25 Jan 2013) > > The funcion "isCulled(node)" might return true because > node->_numChildrenWithCullingDisabled is not 0, and in that case > "getCurrentCullingSet().isCulled(node.getBound())" is never executed. The > getCurrentCullingSet()->_frustrum->_resultMask is never updated, and should > not be pushed. > The current code results in a failure to cull nodes, so the bug never has a > visible impact, only a performance impact. > > I have created an example showing the bug, abusing the option of a proxynode > to indicate a bounding sphere. > The shiny cow is culled as if it's on the position of the white wire-frame > cow. > The red sphere has it's culling disabled. > The blue and green spere set the _resultmask, causing the cow not to be > culled against the frustrum planes they are fully inside off. > > This example should show a blinking cow, not culled with the green sphere > fully inside the right clipping plane, while disappearing when the blue > sphere is crossing the right screen edge. > > set OSG_OPTIMIZER=OFF > osgviewer --window 10 10 800 600 lying_cow_proxy.osg -p saved_animation.path > > To be clear: the cow should not blink, it should be culled. > > The patch resolves the problem, only the call to pushCurrentMask() in the > function void CullVisitor::apply(Projection& node) remains. It might need > the same treatment as the other calls, but if I read the code correctly it > does not do anything anyway and could simply be removed. > > Regards, Laurens. > > _______________________________________________ > osg-submissions mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org > _______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
