Hi Andrew,

I was trying to accomplish exactly the same and finally found a solution, if you search the mailing list for "Disabling small feature culling for a subgraph" you will find the email thread when I discussed this with Robert. I've pasted the final solution below for your convinienc.

Regards
/Per

Hi,

For the record I've found a way to get things working the way I want it, by changing the culling mask of the culling set at the back of the projection culling stack, small feature culling can now be both enabled and disabled for subgraphs. The code for my callback looks like this now (the code is for enabling small feature culling, change the "|" to "& ~" to disable small feature culling):

virtual void operator() (osg::Node *node, osg::NodeVisitor *nv)
{
  osgUtil::CullVisitor *cv = dynamic_cast<osgUtil::CullVisitor*>(nv);
  if(cv){
osg::CullStack::CullingStack &projCullStack = cv->getProjectionCullingStack();
    if(!projCullStack.empty()){
      osg::CullingSet& cullingSet = projCullStack.back();
      osg::CullingSet::Mask cullingSetMask = cullingSet.getCullingMask();
cullingSet.setCullingMask(cullingSetMask | osg::CullSettings::SMALL_FEATURE_CULLING);

      traverse(node,nv);
            cullingSet.setCullingMask(cullingSetMask);
    }else
      // Do not really now what to do if it is empty
      traverse(node,nv);
  }else
    traverse(node,nv);
}

Andrew Thompson wrote:
Hi there, and thanks for your response, well I am using small feature culling in my application to improve performance. Its a CAD-style app and I have hundreds of thousands of Geodes on the screen at any one time. Many are really small so I am throttling small-feature culling to maintain a decent framerate when moving around. When static the scene re-draws everything. But - there are certain objects, markers around the scene, I'd like to exclude from the small feature cull if possible. If its not possible, no matter, just was hoping there was a simple solution to this. Thank you, Andrew

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=17154#17154





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to