From 8e84722f90092756cb152e804aa16984eab39367 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 12 Nov 2002 10:22:38 +0000 Subject: [PATCH] Added LEFT_EYE and RIGHT_EYE stereo to osg::DisplaySettings/osgUtil::SceneView Renamed LODBias to LODScale. --- Make/debugtests.bat | 4 +- Make/makedefs | 7 +- Make/osgtests.bat | 4 +- include/osg/CollectOccludersVisitor | 4 +- include/osg/CullStack | 6 +- include/osg/DisplaySettings | 4 +- include/osg/NodeVisitor | 4 +- include/osgUtil/CullVisitor | 4 +- include/osgUtil/SceneView | 6 +- src/osg/CollectOccludersVisitor.cpp | 10 +- src/osg/CullStack.cpp | 2 +- src/osg/DisplaySettings.cpp | 12 ++ src/osgGLUT/Viewer.cpp | 4 +- src/osgUtil/CullVisitor.cpp | 12 +- src/osgUtil/SceneView.cpp | 201 ++++++++++++++++++---------- 15 files changed, 180 insertions(+), 104 deletions(-) diff --git a/Make/debugtests.bat b/Make/debugtests.bat index 89db5b967..a705581b9 100755 --- a/Make/debugtests.bat +++ b/Make/debugtests.bat @@ -82,8 +82,8 @@ echo osglight glider.osg osglight glider.osg more memleaks.log -echo osgimpostor Town.osg -osgimpostor Town.osg +echo osgimpostor +osgimpostor more memleaks.log echo osgmultitexture cessnafire.osg diff --git a/Make/makedefs b/Make/makedefs index 13bbb0a0c..412da0233 100644 --- a/Make/makedefs +++ b/Make/makedefs @@ -291,9 +291,10 @@ ifeq ($(OS),Darwin) LIB_EXT = dylib QUICKTIME = -framework QuickTime $(CARBON_LIB) TIFF_LIB = -ltiff - SRC_DIRS = osg osgUtil osgDB \ - osgGA osgGLUT \ - osgPlugins osgParticle \ + # src libs which require external libs: osgText + SRC_DIRS = osg osgUtil osgDB osgParticle\ + osgGA osgGLUT \ + osgPlugins \ Demos LIBVERSION = -dylib_current_version 0.9.1 diff --git a/Make/osgtests.bat b/Make/osgtests.bat index 196903ebf..e22018fa6 100755 --- a/Make/osgtests.bat +++ b/Make/osgtests.bat @@ -58,8 +58,8 @@ osghud dumptruck.osg echo osglight glider.osg osglight glider.osg -echo osgimpostor Town.osg -osgimpostor Town.osg +echo osgimpostor +osgimpostor echo osgmultitexture cessnafire.osg osgmultitexture cessnafire.osg diff --git a/include/osg/CollectOccludersVisitor b/include/osg/CollectOccludersVisitor index 6f8ea134c..82bda4e3e 100644 --- a/include/osg/CollectOccludersVisitor +++ b/include/osg/CollectOccludersVisitor @@ -26,8 +26,8 @@ class SG_EXPORT CollectOccludersVisitor : public osg::NodeVisitor, public osg::C virtual void reset(); - virtual float getDistanceToEyePoint(const Vec3& pos, bool withLODBias) const; - virtual float getDistanceFromEyePoint(const Vec3& pos, bool withLODBias) const; + virtual float getDistanceToEyePoint(const Vec3& pos, bool withLODScale) const; + virtual float getDistanceFromEyePoint(const Vec3& pos, bool withLODScale) const; virtual void apply(osg::Node&); virtual void apply(osg::Transform& node); diff --git a/include/osg/CullStack b/include/osg/CullStack index 4b25f6b8d..2e279f540 100644 --- a/include/osg/CullStack +++ b/include/osg/CullStack @@ -66,8 +66,8 @@ class SG_EXPORT CullStack /** Returns the current CullingMode.*/ CullingMode getCullingMode() const { return _cullingMode; } - void setLODBias(float bias) { _LODBias = bias; } - float getLODBias() const { return _LODBias; } + void setLODScale(float bias) { _LODScale = bias; } + float getLODScale() const { return _LODScale; } void setSmallFeatureCullingPixelSize(float value) { _smallFeatureCullingPixelSize=value; } float getSmallFeatureCullingPixelSize() const { return _smallFeatureCullingPixelSize; } @@ -163,7 +163,7 @@ class SG_EXPORT CullStack void popCullingSet(); CullingMode _cullingMode; - float _LODBias; + float _LODScale; float _smallFeatureCullingPixelSize; // base set of shadow volume occluder to use in culling. diff --git a/include/osg/DisplaySettings b/include/osg/DisplaySettings index dd595e871..104579703 100644 --- a/include/osg/DisplaySettings +++ b/include/osg/DisplaySettings @@ -64,7 +64,9 @@ class SG_EXPORT DisplaySettings : public osg::Referenced QUAD_BUFFER, ANAGLYPHIC, HORIZONTAL_SPLIT, - VERTICAL_SPLIT + VERTICAL_SPLIT, + LEFT_EYE, + RIGHT_EYE }; void setStereoMode(StereoMode mode) { _stereoMode = mode; } diff --git a/include/osg/NodeVisitor b/include/osg/NodeVisitor index e71097426..96dc5ec07 100644 --- a/include/osg/NodeVisitor +++ b/include/osg/NodeVisitor @@ -192,12 +192,12 @@ class SG_EXPORT NodeVisitor : public Referenced /** Get the distance from a point to the eye point, distance value in local coordinate system. * Note, not all NodeVisitor implement this method, it is mainly cull visitors which will implement. * If the getDistianceFromEyePoint(pos) is not implmented than a default value of 0.0 is returned.*/ - virtual float getDistanceToEyePoint(const Vec3& /*pos*/, bool /*useLODBias*/) const { return 0.0f; } + virtual float getDistanceToEyePoint(const Vec3& /*pos*/, bool /*useLODScale*/) const { return 0.0f; } /** Get the distance of a point from the eye point, distance value in the eye coordinate system. * Note, not all NodeVisitor implement this method, it is mainly cull visitors which will implement. * If the getDistianceFromEyePoint(pos) is not implmented than a default value of 0.0 is returned.*/ - virtual float getDistanceFromEyePoint(const Vec3& /*pos*/, bool /*useLODBias*/) const { return 0.0f; } + virtual float getDistanceFromEyePoint(const Vec3& /*pos*/, bool /*useLODScale*/) const { return 0.0f; } virtual void apply(Node& node) { traverse(node);} diff --git a/include/osgUtil/CullVisitor b/include/osgUtil/CullVisitor index b27cb294c..42318e11e 100644 --- a/include/osgUtil/CullVisitor +++ b/include/osgUtil/CullVisitor @@ -48,8 +48,8 @@ class OSGUTIL_EXPORT CullVisitor : public osg::NodeVisitor, public osg::CullStac virtual void reset(); - virtual float getDistanceToEyePoint(const osg::Vec3& pos, bool withLODBias) const; - virtual float getDistanceFromEyePoint(const osg::Vec3& pos, bool withLODBias) const; + virtual float getDistanceToEyePoint(const osg::Vec3& pos, bool withLODScale) const; + virtual float getDistanceFromEyePoint(const osg::Vec3& pos, bool withLODScale) const; virtual void apply(osg::Node&); virtual void apply(osg::Geode& node); diff --git a/include/osgUtil/SceneView b/include/osgUtil/SceneView index 6f80c4008..637149794 100644 --- a/include/osgUtil/SceneView +++ b/include/osgUtil/SceneView @@ -167,10 +167,10 @@ class OSGUTIL_EXPORT SceneView : public osg::Referenced const osg::Node::NodeMask getCullMaskRight() const { return _cullMaskRight; } /** Set the LOD bias for the CullVisitor to use.*/ - void setLODBias(float bias) { _LODBias = bias; } + void setLODScale(float bias) { _LODScale = bias; } /** Get the LOD bias.*/ - float getLODBias() const { return _LODBias; } + float getLODScale() const { return _LODScale; } /** Set the Small Feature Culling Pixel Size.*/ void setSmallFeatureCullingPixelSize(float value) { _smallFeatureCullingPixelSize=value; } @@ -319,7 +319,7 @@ class OSGUTIL_EXPORT SceneView : public osg::Referenced CullVisitor::ComputeNearFarMode _computeNearFar; osg::CullStack::CullingMode _cullingMode; - float _LODBias; + float _LODScale; float _smallFeatureCullingPixelSize; FusionDistanceMode _fusionDistanceMode; diff --git a/src/osg/CollectOccludersVisitor.cpp b/src/osg/CollectOccludersVisitor.cpp index 29e7b58f1..5739ede89 100644 --- a/src/osg/CollectOccludersVisitor.cpp +++ b/src/osg/CollectOccludersVisitor.cpp @@ -32,19 +32,19 @@ void CollectOccludersVisitor::reset() CullStack::reset(); } -float CollectOccludersVisitor::getDistanceToEyePoint(const Vec3& pos, bool withLODBias) const +float CollectOccludersVisitor::getDistanceToEyePoint(const Vec3& pos, bool withLODScale) const { - if (withLODBias) return (pos-getEyeLocal()).length()*getLODBias(); + if (withLODScale) return (pos-getEyeLocal()).length()*getLODScale(); else return (pos-getEyeLocal()).length(); } -float CollectOccludersVisitor::getDistanceFromEyePoint(const Vec3& pos, bool withLODBias) const +float CollectOccludersVisitor::getDistanceFromEyePoint(const Vec3& pos, bool withLODScale) const { const Matrix& matrix = *_modelviewStack.back(); float dist = -(pos[0]*matrix(0,2)+pos[1]*matrix(1,2)+pos[2]*matrix(2,2)+matrix(3,2)); - if (withLODBias) return dist*getLODBias(); - else return dist*getLODBias(); + if (withLODScale) return dist*getLODScale(); + else return dist*getLODScale(); } void CollectOccludersVisitor::apply(osg::Node& node) diff --git a/src/osg/CullStack.cpp b/src/osg/CullStack.cpp index 87edc213e..b67e2cc63 100644 --- a/src/osg/CullStack.cpp +++ b/src/osg/CullStack.cpp @@ -5,7 +5,7 @@ using namespace osg; CullStack::CullStack() { _cullingMode = ENABLE_ALL_CULLING; - _LODBias = 1.0f; + _LODScale = 1.0f; _smallFeatureCullingPixelSize = 2.0f; _frustumVolume=-1.0f; _bbCornerNear = 0; diff --git a/src/osg/DisplaySettings.cpp b/src/osg/DisplaySettings.cpp index efc7d9912..163b1aafa 100644 --- a/src/osg/DisplaySettings.cpp +++ b/src/osg/DisplaySettings.cpp @@ -129,6 +129,16 @@ void DisplaySettings::readEnvironmentalVariables() { _stereoMode = VERTICAL_SPLIT; } + else + if (strcmp(ptr,"LEFT_EYE")==0) + { + _stereoMode = LEFT_EYE; + } + else + if (strcmp(ptr,"RIGHT_EYE")==0) + { + _stereoMode = RIGHT_EYE; + } } if( (ptr = getenv("OSG_STEREO")) != 0) @@ -230,6 +240,8 @@ void DisplaySettings::readCommandLine(std::vector& commandLine) else if (*itr=="QUAD_BUFFER") { _stereo = true;_stereoMode = QUAD_BUFFER; ++itr; } else if (*itr=="HORIZONTAL_SPLIT") { _stereo = true;_stereoMode = HORIZONTAL_SPLIT; ++itr; } else if (*itr=="VERTICAL_SPLIT") { _stereo = true;_stereoMode = VERTICAL_SPLIT; ++itr; } + else if (*itr=="LEFT_EYE") { _stereo = true;_stereoMode = LEFT_EYE; ++itr; } + else if (*itr=="RIGHT_EYE") { _stereo = true;_stereoMode = RIGHT_EYE; ++itr; } else if (*itr=="ON") { _stereo = true; ++itr; } else if (*itr=="OFF") { _stereo = false; ++itr; } } diff --git a/src/osgGLUT/Viewer.cpp b/src/osgGLUT/Viewer.cpp index 0fe48a30b..e865f6341 100644 --- a/src/osgGLUT/Viewer.cpp +++ b/src/osgGLUT/Viewer.cpp @@ -958,11 +958,11 @@ void Viewer::keyboard(unsigned char key, int x, int y) break; case '/' : - if (sceneView->getLODBias()>0.5) sceneView->setLODBias(sceneView->getLODBias()/1.5f); + if (sceneView->getLODScale()>0.5) sceneView->setLODScale(sceneView->getLODScale()/1.5f); break; case '*' : - if (sceneView->getLODBias()<30) sceneView->setLODBias(sceneView->getLODBias()*1.5f); + if (sceneView->getLODScale()<30) sceneView->setLODScale(sceneView->getLODScale()*1.5f); break; case '+' : diff --git a/src/osgUtil/CullVisitor.cpp b/src/osgUtil/CullVisitor.cpp index 974f64049..282554cd9 100644 --- a/src/osgUtil/CullVisitor.cpp +++ b/src/osgUtil/CullVisitor.cpp @@ -132,9 +132,9 @@ void CullVisitor::reset() } -float CullVisitor::getDistanceToEyePoint(const Vec3& pos, bool withLODBias) const +float CullVisitor::getDistanceToEyePoint(const Vec3& pos, bool withLODScale) const { - if (withLODBias) return (pos-getEyeLocal()).length()*getLODBias(); + if (withLODScale) return (pos-getEyeLocal()).length()*getLODScale(); else return (pos-getEyeLocal()).length(); } @@ -143,13 +143,13 @@ inline float distance(const osg::Vec3& coord,const osg::Matrix& matrix) return -(coord[0]*matrix(0,2)+coord[1]*matrix(1,2)+coord[2]*matrix(2,2)+matrix(3,2)); } -float CullVisitor::getDistanceFromEyePoint(const osg::Vec3& pos, bool withLODBias) const +float CullVisitor::getDistanceFromEyePoint(const osg::Vec3& pos, bool withLODScale) const { const Matrix& matrix = *_modelviewStack.back(); float dist = distance(pos,matrix); - if (withLODBias) return dist*getLODBias(); - else return dist*getLODBias(); + if (withLODScale) return dist*getLODScale(); + else return dist*getLODScale(); } void CullVisitor::popProjectionMatrix() @@ -561,7 +561,7 @@ void CullVisitor::apply(Impostor& node) float distance2 = (eyeLocal-bs.center()).length2(); if (!_impostorActive || - distance2*_LODBias*_LODBiasgetStereo()) { @@ -269,74 +285,114 @@ void SceneView::cull() float sd = _displaySettings->getScreenDistance(); float es = 0.5f*iod*(fusionDistance/sd); - if (!_cullVisitorLeft.valid()) _cullVisitorLeft = dynamic_cast(_cullVisitor->cloneType()); - if (!_rendergraphLeft.valid()) _rendergraphLeft = dynamic_cast(_rendergraph->cloneType()); - if (!_renderStageLeft.valid()) _renderStageLeft = dynamic_cast(_renderStage->clone(osg::CopyOp::DEEP_COPY_ALL)); - - if (!_cullVisitorRight.valid()) _cullVisitorRight = dynamic_cast(_cullVisitor->cloneType()); - if (!_rendergraphRight.valid()) _rendergraphRight = dynamic_cast(_rendergraph->cloneType()); - if (!_renderStageRight.valid()) _renderStageRight = dynamic_cast(_renderStage->clone(osg::CopyOp::DEEP_COPY_ALL)); - - - // set up the left eye. - osg::ref_ptr projectionLeft = osgNew osg::Matrix(osg::Matrix(1.0f,0.0f,0.0f,0.0f, - 0.0f,1.0f,0.0f,0.0f, - iod/(2.0f*sd),0.0f,1.0f,0.0f, - 0.0f,0.0f,0.0f,1.0f)* - (*projection)); - - - osg::ref_ptr modelviewLeft = osgNew osg::Matrix( (*modelview) * - osg::Matrix(1.0f,0.0f,0.0f,0.0f, - 0.0f,1.0f,0.0f,0.0f, - 0.0f,0.0f,1.0f,0.0f, - es,0.0f,0.0f,1.0f)); - - _cullVisitorLeft->setTraversalMask(_cullMaskLeft); - cullStage(projectionLeft.get(),modelviewLeft.get(),_cullVisitorLeft.get(),_rendergraphLeft.get(),_renderStageLeft.get()); - - - // set up the right eye. - osg::ref_ptr projectionRight = osgNew osg::Matrix(osg::Matrix(1.0f,0.0f,0.0f,0.0f, - 0.0f,1.0f,0.0f,0.0f, - -iod/(2.0f*sd),0.0f,1.0f,0.0f, - 0.0f,0.0f,0.0f,1.0f)* - (*projection)); - - osg::ref_ptr modelviewRight = osgNew osg::Matrix( (*modelview) * - osg::Matrix(1.0f,0.0f,0.0f,0.0f, - 0.0f,1.0f,0.0f,0.0f, - 0.0f,0.0f,1.0f,0.0f, - -es,0.0f,0.0f,1.0f)); - - _cullVisitorRight->setTraversalMask(_cullMaskRight); - cullStage(projectionRight.get(),modelviewRight.get(),_cullVisitorRight.get(),_rendergraphRight.get(),_renderStageRight.get()); - - - if (_camera.valid() && _computeNearFar != CullVisitor::DO_NOT_COMPUTE_NEAR_FAR) + if (_displaySettings->getStereoMode()==osg::DisplaySettings::LEFT_EYE) { - // clamp the camera to the near/far computed in cull traversal. - _camera->setNearFar(_cullVisitorRight->getCalculatedNearPlane(),_cullVisitorRight->getCalculatedFarPlane()); + // set up the left eye. + osg::ref_ptr projectionLeft = osgNew osg::Matrix(osg::Matrix(1.0f,0.0f,0.0f,0.0f, + 0.0f,1.0f,0.0f,0.0f, + iod/(2.0f*sd),0.0f,1.0f,0.0f, + 0.0f,0.0f,0.0f,1.0f)* + (*projection)); + + + osg::ref_ptr modelviewLeft = osgNew osg::Matrix( (*modelview) * + osg::Matrix(1.0f,0.0f,0.0f,0.0f, + 0.0f,1.0f,0.0f,0.0f, + 0.0f,0.0f,1.0f,0.0f, + es,0.0f,0.0f,1.0f)); + + _cullVisitor->setTraversalMask(_cullMaskLeft); + cullStage(projectionLeft.get(),modelviewLeft.get(),_cullVisitor.get(),_rendergraph.get(),_renderStage.get()); + + if (_camera.valid() && _computeNearFar != CullVisitor::DO_NOT_COMPUTE_NEAR_FAR) + { + // clamp the camera to the near/far computed in cull traversal. + _camera->setNearFar(_cullVisitor->getCalculatedNearPlane(),_cullVisitor->getCalculatedFarPlane()); + } + } + else if (_displaySettings->getStereoMode()==osg::DisplaySettings::RIGHT_EYE) + { + // set up the right eye. + osg::ref_ptr projectionRight = osgNew osg::Matrix(osg::Matrix(1.0f,0.0f,0.0f,0.0f, + 0.0f,1.0f,0.0f,0.0f, + -iod/(2.0f*sd),0.0f,1.0f,0.0f, + 0.0f,0.0f,0.0f,1.0f)* + (*projection)); + + osg::ref_ptr modelviewRight = osgNew osg::Matrix( (*modelview) * + osg::Matrix(1.0f,0.0f,0.0f,0.0f, + 0.0f,1.0f,0.0f,0.0f, + 0.0f,0.0f,1.0f,0.0f, + -es,0.0f,0.0f,1.0f)); + + _cullVisitor->setTraversalMask(_cullMaskRight); + cullStage(projectionRight.get(),modelviewRight.get(),_cullVisitor.get(),_rendergraph.get(),_renderStage.get()); + + + if (_camera.valid() && _computeNearFar != CullVisitor::DO_NOT_COMPUTE_NEAR_FAR) + { + // clamp the camera to the near/far computed in cull traversal. + _camera->setNearFar(_cullVisitor->getCalculatedNearPlane(),_cullVisitor->getCalculatedFarPlane()); + } + } + else + { + + if (!_cullVisitorLeft.valid()) _cullVisitorLeft = dynamic_cast(_cullVisitor->cloneType()); + if (!_rendergraphLeft.valid()) _rendergraphLeft = dynamic_cast(_rendergraph->cloneType()); + if (!_renderStageLeft.valid()) _renderStageLeft = dynamic_cast(_renderStage->clone(osg::CopyOp::DEEP_COPY_ALL)); + + if (!_cullVisitorRight.valid()) _cullVisitorRight = dynamic_cast(_cullVisitor->cloneType()); + if (!_rendergraphRight.valid()) _rendergraphRight = dynamic_cast(_rendergraph->cloneType()); + if (!_renderStageRight.valid()) _renderStageRight = dynamic_cast(_renderStage->clone(osg::CopyOp::DEEP_COPY_ALL)); + + + // set up the left eye. + osg::ref_ptr projectionLeft = osgNew osg::Matrix(osg::Matrix(1.0f,0.0f,0.0f,0.0f, + 0.0f,1.0f,0.0f,0.0f, + iod/(2.0f*sd),0.0f,1.0f,0.0f, + 0.0f,0.0f,0.0f,1.0f)* + (*projection)); + + + osg::ref_ptr modelviewLeft = osgNew osg::Matrix( (*modelview) * + osg::Matrix(1.0f,0.0f,0.0f,0.0f, + 0.0f,1.0f,0.0f,0.0f, + 0.0f,0.0f,1.0f,0.0f, + es,0.0f,0.0f,1.0f)); + + _cullVisitorLeft->setTraversalMask(_cullMaskLeft); + cullStage(projectionLeft.get(),modelviewLeft.get(),_cullVisitorLeft.get(),_rendergraphLeft.get(),_renderStageLeft.get()); + + + // set up the right eye. + osg::ref_ptr projectionRight = osgNew osg::Matrix(osg::Matrix(1.0f,0.0f,0.0f,0.0f, + 0.0f,1.0f,0.0f,0.0f, + -iod/(2.0f*sd),0.0f,1.0f,0.0f, + 0.0f,0.0f,0.0f,1.0f)* + (*projection)); + + osg::ref_ptr modelviewRight = osgNew osg::Matrix( (*modelview) * + osg::Matrix(1.0f,0.0f,0.0f,0.0f, + 0.0f,1.0f,0.0f,0.0f, + 0.0f,0.0f,1.0f,0.0f, + -es,0.0f,0.0f,1.0f)); + + _cullVisitorRight->setTraversalMask(_cullMaskRight); + cullStage(projectionRight.get(),modelviewRight.get(),_cullVisitorRight.get(),_rendergraphRight.get(),_renderStageRight.get()); + + + if (_camera.valid() && _computeNearFar != CullVisitor::DO_NOT_COMPUTE_NEAR_FAR) + { + // clamp the camera to the near/far computed in cull traversal. + _camera->setNearFar(_cullVisitorRight->getCalculatedNearPlane(),_cullVisitorRight->getCalculatedFarPlane()); + } + } } else { - if (!_cullVisitor) - { - osg::notify(osg::INFO) << "Warning: no valid osgUtil::SceneView:: attached, creating a default CullVisitor automatically."<< std::endl; - _cullVisitor = osgNew CullVisitor; - } - if (!_rendergraph) - { - osg::notify(osg::INFO) << "Warning: no valid osgUtil::SceneView:: attached, creating a global default RenderGraph automatically."<< std::endl; - _rendergraph = osgNew RenderGraph; - } - if (!_renderStage) - { - osg::notify(osg::INFO) << "Warning: no valid osgUtil::SceneView::_renderStage attached, creating a default RenderStage automatically."<< std::endl; - _renderStage = osgNew RenderStage; - } _cullVisitor->setTraversalMask(_cullMask); cullStage(projection.get(),modelview.get(),_cullVisitor.get(),_rendergraph.get(),_renderStage.get()); @@ -410,7 +466,7 @@ void SceneView::cullStage(osg::Matrix* projection,osg::Matrix* modelview,osgUtil cullVisitor->setCullingMode(_cullingMode); cullVisitor->setComputeNearFarMode(_computeNearFar); - cullVisitor->setLODBias(_LODBias); + cullVisitor->setLODScale(_LODScale); cullVisitor->setSmallFeatureCullingPixelSize(_smallFeatureCullingPixelSize); cullVisitor->setClearNode(NULL); // reset earth sky on each frame. @@ -638,12 +694,17 @@ void SceneView::draw() } } break; + case(osg::DisplaySettings::RIGHT_EYE): + case(osg::DisplaySettings::LEFT_EYE): + { + _globalState->setAttribute(_viewport.get()); + _renderStage->drawPreRenderStages(*_state,previous); + _renderStage->draw(*_state,previous); + } + break; default: { osg::notify(osg::NOTICE)<<"Warning: stereo camera mode not implemented yet."<< std::endl; - _globalState->setAttribute(_viewport.get()); - _renderStageLeft->drawPreRenderStages(*_state,previous); - _renderStageLeft->draw(*_state,previous); } break; } @@ -651,9 +712,9 @@ void SceneView::draw() else { _globalState->setAttribute(_viewport.get()); - osg::ref_ptr cmask = osgNew osg::ColorMask; - cmask->setMask(true,true,true,true); - _globalState->setAttribute(cmask.get()); +// osg::ref_ptr cmask = osgNew osg::ColorMask; +// cmask->setMask(true,true,true,true); +// _globalState->setAttribute(cmask.get()); // bog standard draw. _renderStage->drawPreRenderStages(*_state,previous);