Added osg::EarthSky node to the core osg library, and added support for it into

osgUtil::SceneView, osg::CullVisitor, osgPlugin/osg and updated the hangglide
demo to use the new earth sky node.
This commit is contained in:
Robert Osfield
2001-10-02 11:36:14 +00:00
parent fc1fa57275
commit 430c8606e9
8 changed files with 67 additions and 8 deletions

View File

@@ -135,6 +135,7 @@ void SceneView::cull()
_cullVisitor->setLODBias(_lodBias);
_cullVisitor->setCamera(*_camera);
_cullVisitor->setViewport(_viewport.get());
_cullVisitor->setEarthSky(NULL); // reset earth sky on each frame.
_renderStage->reset();
@@ -170,6 +171,24 @@ void SceneView::cull()
_renderStage->sort();
const osg::EarthSky* earthSky = _cullVisitor->getEarthSky();
if (earthSky)
{
if (earthSky->getRequiresClear())
{
_renderStage->setClearColor(earthSky->getClearColor());
// really should set clear mask here, but what to? Need
// to consider the stencil and accumulation buffers..
// will defer to later. Robert Osfield. October 2001.
}
else
{
// we have an earth sky implementation to do the work for use
// so we don't need to clear.
_renderStage->setClearMask(0);
}
}
// prune out any empty RenderGraph children.
// note, this would be not required if the _renderGraph had been
// reset at the start of each frame (see top of this method) but