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
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org