By default some of the parameters of a camera are computed based on
the contents of a scene (like the near and far plane). Camera
manipulators will also behave differently based on the placement of
objects in the scene. I have one node in my scene that I want the
camera and any manipulators to 'ignore' in this respect, but I still
want the node to be rendered. Is there anyway I can do this?
--
behaviour without the Earth surface geometry is perfect as is. I don't
care about the overhead of drawing the surface geometry since its so
simple, and I don't want the scene graph to account for the surface
geometry (outside of rendering it); the other objects in the scene
should determine the camera frustum.
You can set ComputeBoundingBoxCallback on a geometry to specify whatever bounds you want. In your case to ignore earth geometry bound you can set its bound to uninitialized bounding box, and it will not make any difference to near\far calculations. Note that this thing completely disable view frustum culling on a geometry! In order to get it working you should write your cull callback and do check vs actual bounds there, if you need it.
Code looks like:
class UseInitialBoundsCallback : public osg::Drawable::ComputeBoundingBoxCallback
{
public:
osg::BoundingBox computeBound (const osg::Drawable & drawable)
{
osg::BoundingBox brand_new_uninitialized_bbox;
return brand_new_uninitialized_bbox;
}
};
geometry->setComputeBoundingBoxCallback(new UseInitialBoundsCallback);
Cheers, Sergey.
05.10.2012, 05:11, "Preet" <prismati...@gmail.com>:
,
I believe this caused by small features culling (which is culling away objects which cover less space on screen than some pixel threshold). With compute near far enabled - when camera far enough objects on earth surface gets culled away, and as there are no objects on earth surface get's rendered, far plane calculated is just to close for earth to be visible.
To check if this causing problems try to set culling mode to myCam->setCullingMode(myCam->getCullingMode() & (~osg::CullSettings::SMALL_FEATURE_CULLING));
You can incorporate some logic into bounds computation to return valid bound when camera is far from earth surface, or disable small feature culling (or just reduce it's threshold)
Cheers.
06.10.2012, 09:16, "Preet" <prismati...@gmail.com>: