Hi John,
On Tue, Sep 28, 2010 at 6:36 PM, John Stokes <[email protected]> wrote:
> When I comment out the updated "setComputeNearFarMode" line of code, my globe
> and sky models show up correctly but my plane model disappears. Is there a
> correct cull setting that I should be using to get everything to display?
>
> I tried using the "COMPUTE_NEAR_FAR_USING_PRIMITIVES" and
> "COMPUTE_NEAR_FAR_USING_BOUNDING_VALUES" with this call, but I'm not quite
> sure what bounding value I should be using or if I should be looking at
> another culling method.
OK, this is good, you've isolated the issue to one of management of
the near/far planes, so now it's a case of finding the appropriate
technique for you type of application/models.
First up the near/far planes are computed during the cull traversal,
using COMPUTE_NEAR_FAR_USING_PRIMITIVES will be more accurate and
provide a tighter bound than COMPUTE_NEAR_FAR_USING_BOUNDING_VOLUMES
but it's more expensive to compute. Both techniques still use
clamping of the near/far values to avoid the ratio getting too low
which will cause z fighting, this clamping by default pushes out the
near value to obtain a specified near/far ratio. The
CullSetting::setNearFarRatio(double) sets this value, and Camera
subclasses from CullSettings so you can do:
camera->setNearFarRatio(0.0001); // default value is 0.0005;
It may well be that this in OSG-2.x this near/far ratio is set more
conservatively than OSG-0.9.9 and is the reason why you are seeing
differences. Have a look at the source code to see what the old
default value was.
--
For scenes which have a very large depth range that tweaking the
near/far planes isn't sufficient it can be useful to using depth
partioning, where you render the scene two or more times, varying the
region that is rendered in each pass. This osgdepthpartion examples
shows this in action. This example is a bit out of date and should
really be implemented with viewer slave Cameras rather than in scene
graph Camera, but the principles are the same.
Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org