Hi Robert,

On Mon, Jul 9, 2012 at 9:01 AM, Robert Osfield <[email protected]> wrote:
> HI Preet,
>
> You'll need to rest OpenGL into consistent state when moving between
> Qt and the OSG.  I don't know anything about QGLFrameBufferObject so
> can't comment on what state it'll be managing.

This was indeed the case. For anyone else that runs into issues
integrating the two libs, I've found some OpenGL states that should be
reset after drawing an OSG frame, before control is given back to Qt.
More state settings might need to be changed depending on what exactly
OpenSceneGraph is being used for, but the following seems to work with
some basic textured geometry.

// qpainter uses vertex attribs 3,4,5 so we need to explicitly disable them:
glDisableVertexAttribArray(3);
glDisableVertexAttribArray(4);
glDisableVertexAttribArray(5);

// qpainter requires depth testing to be off
glDisable(GL_DEPTH_TEST)

// not sure if this is required; osg changes this when using textures
so I reset it to default
glPixelStorei(GL_UNPACK_ALIGNMENT,4);

>
> What I can say is that the OSG has it's own native FBO support that
> will work just fine all by itself and normally there wouldn't be any
> need to get QT involved.  Personally I'd try to keep Qt out for doing
> too much OpenGL work itself.
>
> Robert.
>
> On 5 July 2012 01:30, Preet <[email protected]> wrote:
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to