diff --git a/include/osg/GraphicsContext b/include/osg/GraphicsContext index 54673aa52..4312c079b 100644 --- a/include/osg/GraphicsContext +++ b/include/osg/GraphicsContext @@ -71,6 +71,7 @@ class OSG_EXPORT GraphicsContext : public Object quadBufferStereo(false), doubleBuffer(false), target(0), + format(0), level(0), face(0), mipMapGeneration(false), @@ -110,6 +111,7 @@ class OSG_EXPORT GraphicsContext : public Object // render to texture GLenum target; + GLenum format; unsigned int level; unsigned int face; unsigned int mipMapGeneration; diff --git a/src/osgUtil/RenderStage.cpp b/src/osgUtil/RenderStage.cpp index 7414e0aee..8a79e9207 100644 --- a/src/osgUtil/RenderStage.cpp +++ b/src/osgUtil/RenderStage.cpp @@ -504,6 +504,7 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo) if (renderTargetImplemntation==osg::Camera::PIXEL_BUFFER_RTT) { traits->target = attachment._texture.valid() ? attachment._texture->getTextureTarget() : 0; + traits->format = bufferFormat; traits->level = level; traits->face = face; traits->mipMapGeneration = attachment._mipMapGeneration;