Re: [osg-users] Culling with custom clip planes

2015-10-24 Thread Jannik Heller
Hi Robert, I have just noticed that approach of adding culling planes doesn't work 100% accurately. Some meshes that have their bounding box fully outside of the culling plane don't get culled. To test with please check the attached osgreflect.cpp. I added a culling plane so that everything

Re: [osg-users] Culling with custom clip planes

2015-10-24 Thread Jannik Heller
Oops, wrong file. Use this one please. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=65432#65432 /* OpenSceneGraph example, osgreflect. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and

Re: [osg-users] Culling with custom clip planes

2015-10-24 Thread Jannik Heller
Hi, The interaction of CullingSet, CullStack and CullVisitor is really confusing to look at, but I think I have a lead! It seems like the added frustum plane is reset right here: https://github.com/openscenegraph/osg/blob/master/src/osg/CullStack.cpp#L214 when the cull visitor applies a

Re: [osg-users] Culling with custom clip planes

2015-10-24 Thread Jannik Heller
Ok, setting on projectionCullingStack works fine for the whole subgraph, you just have to transform the plane to view space first: Code: virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) { osgUtil::CullVisitor* cv = dynamic_cast(nv);