Set the draw and read buffer to GL_NONE when using FBO's, thereby avoid
invalid enumrates being generated.
This commit is contained in:
parent
4509232792
commit
e23176c3b6
@ -206,8 +206,8 @@ void RenderStage::runCameraSetUp(osg::State& state)
|
|||||||
|
|
||||||
_fbo = new osg::FrameBufferObject;
|
_fbo = new osg::FrameBufferObject;
|
||||||
|
|
||||||
setDrawBuffer(GL_BACK);
|
setDrawBuffer(GL_NONE);
|
||||||
setReadBuffer(GL_BACK);
|
setReadBuffer(GL_NONE);
|
||||||
|
|
||||||
bool colorAttached = false;
|
bool colorAttached = false;
|
||||||
bool depthAttached = false;
|
bool depthAttached = false;
|
||||||
@ -520,8 +520,6 @@ void RenderStage::drawInner(osg::State& state,RenderLeaf*& previous, bool& doCop
|
|||||||
copyTexture(state);
|
copyTexture(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
state.checkGLErrors("before readPixel;");
|
|
||||||
|
|
||||||
if (_image.valid())
|
if (_image.valid())
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -541,6 +539,7 @@ void RenderStage::drawInner(osg::State& state,RenderLeaf*& previous, bool& doCop
|
|||||||
_image->readPixels(_viewport->x(), _viewport->y(),
|
_image->readPixels(_viewport->x(), _viewport->y(),
|
||||||
_viewport->width(), _viewport->height(),
|
_viewport->width(), _viewport->height(),
|
||||||
pixelFormat, dataType);
|
pixelFormat, dataType);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -550,8 +549,6 @@ void RenderStage::drawInner(osg::State& state,RenderLeaf*& previous, bool& doCop
|
|||||||
(*(_camera->getPostDrawCallback()))(*_camera);
|
(*(_camera->getPostDrawCallback()))(*_camera);
|
||||||
}
|
}
|
||||||
|
|
||||||
state.checkGLErrors("before glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);");
|
|
||||||
|
|
||||||
if (fbo_supported)
|
if (fbo_supported)
|
||||||
{
|
{
|
||||||
// switch of the frame buffer object
|
// switch of the frame buffer object
|
||||||
@ -560,9 +557,6 @@ void RenderStage::drawInner(osg::State& state,RenderLeaf*& previous, bool& doCop
|
|||||||
doCopyTexture = true;
|
doCopyTexture = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
state.checkGLErrors("after glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);");
|
|
||||||
|
|
||||||
|
|
||||||
if (fbo_supported && _camera)
|
if (fbo_supported && _camera)
|
||||||
{
|
{
|
||||||
// now generate mipmaps if they are required.
|
// now generate mipmaps if they are required.
|
||||||
|
Loading…
Reference in New Issue
Block a user