Robert

Thanks a lot - I had missed that completely.

Cheers
Alan

Robert Osfield wrote:
Hi Alan,

The screenshot say alot, it says to me that the problem you have is down to the near clipping plane being too close. The ways to solve this problem are to enable a finer grained way of computing the near/far plane based on polygons intersections with the view frustum and to reduce the near/far distance ratio to allow the near plane to move in nearer to the eye point. Both these can be set in the osg::CullSettings structure:

In osgViewer::Viewer you'd do:

viewer.getCamera()->setComputeNearFarMode(osg::CullSettings::COMPUTE_NEAR_FAR_USING_PRIMITIVES);
  viewer.getCamera()->setNearFarRatio(0.0002f);

You can drop the COMPUTE_NEAR_FAR_USING_PRIMITIVES if you wish as the default COMPUTE_NEAR_FAR_USING_BOUNDING_VOLUMES should suffice given the setNearFarRatio change, the compute using primitives is also more expensive an op so if your a limited by cull traversal then don't use it. What you do gain with compute using primitives is better optimized near/far ratio for each frame, with the OSG pushing out the near plane as far as it can without clipping polygons. Pushing the near plane out is important as it has a huge effect on the numerical precision of the depth buffer.

Robert.

On 4/30/07, *Alan Harris* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    Robert

    I tried to find out a little more detail about what is happening.
    Attached is a screenshot to illustrate the problem. The viewer is 2m
    above the ground height.

    I thought it might be culling one node (5x5 quads plus a 256 pixel
    texture) but the ground surface is clipped as you can see (not at the
    skirts of the database which are also visible) and it is clipped
    smoothly as one advances or retreats - it doesn't suddenly include
    another node.

    It seems to be a clipping problem and not culling. The clipping
    generally occurs when looking uphill - but not enough of a slope
    that I
    expected the near plane to be clipping it.

    I am using the following to set the near clipping plane to 0.001m,
    but I
    suspect I am missing something.
    SceneView::setProjectionMatrixAsPerspective(fovy,aspectRatio,znear,zfar)

    This happens if the window size is changed. On re-entry znear is
    set to
    another value, typically 1/2000 of zfar. Is there a control
    somewhere on
    the ratio or values of znear and zfar?

    I would be grateful if you could point me in the right direction.

    Regards
    Alan Harris

    Robert Osfield wrote:
    > Hi Alan,
    >
    > On 4/26/07, Alan Harris < [EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]>> wrote:
    >> Return of an old question!
    >>
    >> If the corners of the bounding volume (I assume a box) are all
    outside
    >> the view frustrum would that node be culled? I assume a
    bounding box is
    >> used as I would expect a bounding sphere to generally interact
    with the
    >> view frustrum.
    >
    > The Node's all have bounding sphere's that enclose their children.
    >
    > The Drawable leaves all have bounding boxes that enclose their
    geometry.
    >
    > The view frustum culls the above such that if any point of the
    > bounding sphere or bounding box is in the view frustum then its
    > accepted.
    >
    >> I expect it is from what is happening. Therefore is there a
    simple way
    >> of ensuring that culling does not occur on objects within, say, a
    >> specified distance of the viewer.
    >
    > There isn't a way to disable culling for near objects, it
    shouldn't be
    > required any, such a feature would just be a hack around a bug
    > elsewhere in the culling set up - in this case its looks like the
    > ClusterCullingCallback set up is wrong so this is where the fix
    should
    > happen - in the set up of the ClusterCullingCallback.
    >
    > Robert.
    > _______________________________________________
    > osg-users mailing list
    > [email protected] <mailto:[email protected]>
    > http://openscenegraph.net/mailman/listinfo/osg-users
    > http://www.openscenegraph.org/ <http://www.openscenegraph.org/>
    _______________________________________________
    osg-users mailing list
    [email protected] <mailto:[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/
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to