Updates to Stereo code.
This commit is contained in:
parent
0721f0a818
commit
73e598f3ff
@ -17,10 +17,10 @@ void ColorMatrix::apply(State&) const
|
||||
{
|
||||
// std::cout<<"applying matrix"<<_matrix<<std::endl;
|
||||
static bool s_ARB_imaging = isGLExtensionSupported("GL_ARB_imaging");
|
||||
if (s_ARB_imaging)
|
||||
{
|
||||
glMatrixMode( GL_COLOR );
|
||||
glLoadMatrixf( _matrix.ptr() );
|
||||
glMatrixMode( GL_MODELVIEW );
|
||||
}
|
||||
if (s_ARB_imaging)
|
||||
{
|
||||
glMatrixMode( GL_COLOR );
|
||||
glLoadMatrixf( _matrix.ptr() );
|
||||
glMatrixMode( GL_MODELVIEW );
|
||||
}
|
||||
}
|
||||
|
@ -344,13 +344,21 @@ void SceneView::draw()
|
||||
osg::ColorMask* green = new osg::ColorMask;
|
||||
|
||||
red->setMask(true,false,false,true);
|
||||
green->setMask(false,true,true,true);
|
||||
|
||||
// draw right eye.
|
||||
_globalState->setAttribute(red);
|
||||
_renderStage->setColorMask(red);
|
||||
_renderStage->setCamera(left_camera.get());
|
||||
_renderStage->draw(*_state,previous);
|
||||
|
||||
green->setMask(false,true,true,true);
|
||||
_renderStage->setColorMask(green);
|
||||
// need to tell the rendering stage that it can be
|
||||
// called again in this frame.
|
||||
_renderStage->_stageDrawnThisFrame = false;
|
||||
|
||||
// draw left eye.
|
||||
_globalState->setAttribute(green);
|
||||
_renderStage->setColorMask(green);
|
||||
_renderStage->setCamera(right_camera.get());
|
||||
_renderStage->draw(*_state,previous);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user