Hi,

Perhaps I wasn't clear in my question so I will try once more, is there a way to disable small feature culling for just a subgraph not the entire scene?

Regards,
Per

Per Fahlberg wrote:
Hi,

I'm trying to disable small feature culling for a subgraph, but so far I have not been able to disable it with other than calling setCullingActive(false) on the leaf geodes. The leaf geodes are actually shared between several subgraphs and I don't want to disable small feature culling for all of them, so I need a way to disable small feature culling higher up in the scenegraph.

I have tried to use a cull callback to disable small feature culling for the subgraph but without success, the code for the cull callback is pasted below.

class MyCullingCallback : public osg::NodeCallback
{
public:
 MyCullingCallback() : osg::NodeCallback()
 {}

 virtual void operator() (osg::Node *node, osg::NodeVisitor *nv)
 {
   osgUtil::CullVisitor *cv = dynamic_cast<osgUtil::CullVisitor*>(nv);
   if(cv){
     osg::CullSettings::CullingMode cm = cv->getCullingMode();
     cv->setCullingMode(cm & ~osg::CullSettings::SMALL_FEATURE_CULLING);
     traverse(node,nv);
     cv->setCullingMode(cm);
   }else
     traverse(node,nv);
 }
};
...
node->setCullCallback(new MyCullingCallback);

Regards,
Per
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to