Thanks for your comments. I did a patch following this guideline:
Quote:
querying the multisample state in RenderDevice::initStates() and use that state in setRenderBuffer()
The modifications to the samples are based on the new sample framework of zuck, so I will wait until the sample framework reaches the develop branch to send the pull request. In the meantime, please review the core patch below:
Code:
Horde3D/Source/Horde3DEngine/egRendererBase.cpp | 7 ++++++-
Horde3D/Source/Horde3DEngine/egRendererBase.h | 1 +
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/Horde3D/Source/Horde3DEngine/egRendererBase.cpp b/Horde3D/Source/Horde3DEngine/egRendererBase.cpp
index 404e424..8624a50 100644
--- a/Horde3D/Source/Horde3DEngine/egRendererBase.cpp
+++ b/Horde3D/Source/Horde3DEngine/egRendererBase.cpp
@@ -153,6 +153,7 @@ RenderDevice::RenderDevice()
_curVertLayout = _newVertLayout = 0;
_curIndexBuf = _newIndexBuf = 0;
_defaultFBO = 0;
+ _defaultFBOMultisampled = false;
_indexFormat = (uint32)IDXFMT_16;
_pendingMask = 0;
}
@@ -166,6 +167,9 @@ RenderDevice::~RenderDevice()
void RenderDevice::initStates()
{
glPixelStorei( GL_UNPACK_ALIGNMENT, 1 );
+ GLint value;
+ glGetIntegerv( GL_SAMPLE_BUFFERS, &value );
+ _defaultFBOMultisampled = value > 0;
}
@@ -1030,7 +1034,8 @@ void RenderDevice::setRenderBuffer( uint32 rbObj )
if( _defaultFBO == 0 ) glDrawBuffer( _outputBufferIndex == 1 ? GL_BACK_RIGHT : GL_BACK_LEFT );
_fbWidth = _vpWidth + _vpX;
_fbHeight = _vpHeight + _vpY;
- glDisable( GL_MULTISAMPLE );
+ if( _defaultFBOMultisampled ) glEnable( GL_MULTISAMPLE );
+ else glDisable( GL_MULTISAMPLE );
}
else
{
diff --git a/Horde3D/Source/Horde3DEngine/egRendererBase.h b/Horde3D/Source/Horde3DEngine/egRendererBase.h
index 136b2aa..52cfdbc 100644
--- a/Horde3D/Source/Horde3DEngine/egRendererBase.h
+++ b/Horde3D/Source/Horde3DEngine/egRendererBase.h
@@ -588,6 +588,7 @@ protected:
uint32 _textureMem, _bufferMem;
int _defaultFBO;
+ bool _defaultFBOMultisampled;
uint32 _numVertexLayouts;
RDIVertexLayout _vertexLayouts[MaxNumVertexLayouts];
RDIObjects< RDIBuffer > _buffers;