Hi Daniel,

You are hitting up against small feature culling.  If for you
application its inappropriate just switch it off.  See the FAQ for
details.

Robert.

On 6/7/06, Daniel Trstenjak <[EMAIL PROTECTED]> wrote:

Hi all,

if I have a osg::Geometry with one point (GL_POINT) at 0,0,0 than
I get a bounding box with min: 0,0,0 and max: 0,0,0.

The bounding sphere of the osg::Geode, which only contains
this geometry, is center: 0,0,0 and radius: 0.

The first thing which irritates me are the valid methods
of osg::BoudingBox and osg::BoudingSphere.


bool BoundingBox::valid() const
{
    return _max.x()>=_min.x() &&  _max.y()>=_min.y() &&  _max.z()>=_min.z();
}

bool BoundingSphere::valid() const { return _radius>=0.0f; }


What irritates me are the "=". So the above computed bounding
volumes are both valid.


So what happens during culling of a osg::Geode with such
a bounding sphere.

The first method called in osgUtil::CullVisitor::apply(osg::Geode&)
is osg::CullStack::isCulled(osg::Node&) which calls
osg::CullingSet::isCulled(osg::BoundingSphere&):


bool CullingSet::isCulled(const BoundingSphere& bs)
{
    if (_mask&VIEW_FRUSTUM_CULLING)
    {
        // is it outside the view frustum...
        if (!_frustum.contains(bs)) return true;
    }

    if (_mask&SMALL_FEATURE_CULLING)
    {
        if 
(((bs.center()*_pixelSizeVector)*_smallFeatureCullingPixelSize)>bs.radius()) 
return true;
    }
#ifdef COMPILE_WITH_SHADOW_OCCLUSION_CULLING
   if (_mask&SHADOW_OCCLUSION_CULLING)
   {
       // is it in one of the shadow occluder volumes.
       if (!_occluderList.empty())
       {
           for(OccluderList::iterator itr=_occluderList.begin();
               itr!=_occluderList.end();
               ++itr)
           {
               if (itr->contains(bs)) return true;
           }
       }
   }
#endif
    return false;
}


In the case of the bounding sphere (center: 0,0,0 radius: 0)
_frustum.contains(bs) returns true, so the culling of this
"valid" bounding sphere depends only on SMALL_FEATURE_CULLING,
which will return false.


Is this complete behaviour accurate ?

Shouldn't there be a special case in osg::Drawable::computeBound
for a one point geometry ?


Daniel




_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to