Re: [osg-users] osgviewerQT shows garbage when viewer is destroyed and re-created
Qt 4.4 includes a QGraphicsView class, this class can be used to perform OpenGL drawing, instead of using the QGLWidget. This might open up some new possibilities for embedding osg in the QGraphicsView. I will take a look at the possibilities. Rene 2008/8/17 René Molenaar [EMAIL PROTECTED] (i use qt 4.4.1 and osg 2.6, and adapted vierwerqt example sources) The QOSGWidget works for me on linux. On windows I got the pixelformat error but, I got the QOSGWidget to work, and the --CompositeViewer version, by adding the traits-setInheritedWindowPixelFormat = true; line. I don't see any problems running a second time or multiple times. I don't have any windows decorations by default, but these can also be set on. (it helps to set viewerWindow-setGeometry(50,50,640,480); instead of viewerWindow-setGeometry(0,0,640,480);) to prevent the decorations from being outside the screen. ) I did have problems when making the window heigth 0, but this was solved by making the resize always a minumum of one pixel. But i do get some errors in the console: QWidget::repaint: Recursive repaint detected and after closing: Windows Error #6: [Screen #0] GraphicsWindowWin32::makeCurrentImplementation() - Unable to set current OpenGL rendering context. Reason: De ingang is ongeldig. Windows Error #1400: [Screen #0] GraphicsWindowWin32::unregisterWindowProcedure() - Unable to unregister window procedure. Reason: Ongeldige vensteringang. I am still not sure what solution to use, as the ViewerQT version does its job, never had window problems with the AdapterWidget, but the performance of the QOSGWidget seems better. I also use a qtimer that triggers the update, but I want to start a new (singleshot) timer only after the frame is drawn, to make sure every frame is drawn before the timer issues a new frame. Large models seemed to have a problem with the original code. would there be a better solution for the update? Rene Molenaar 2008/5/7 Mathieu Champlon [EMAIL PROTECTED] Hi Robert, I quickly hacked the --QOSGWidget mode in order to work around the invalid pixel format error (forcing traits-setInheritedWindowPixelFormat = true;) and the result is the same : trashed scene on the second run. I tried adding the piece of code you suggested but it does not change anything. By the way the crash you were experiencing running with --QOSGWidget is actually due to osg::ArgumentParser modifying argv, thus on the second run argc remains unchanged but all arguments have actually been eaten up from argv. I am now using this code to run the application twice : int main( int argc, char **argv ) { char** tmp = (char**)malloc( argc * sizeof( char*) ); memcpy( tmp, argv, argc * sizeof( char* ) ); run( argc, argv ); run( argc, tmp ); } MAT. Robert Osfield wrote: Hi Mathieu, The error with -QOSGWidget looks to be a bug in this code, but its a totally different path that the default path which uses GraphicsWindowEmbedded to adapt the Viewer. QOSGWidget is the most flexible path for integration and long term I'd like this to be the default route under Qt. My own time is rather stretched out so I can't address all these things at once. The issues you are seeing with the default path is very unlikely to be related to transparency, most likely is issues with display lists or texture objects being reused inappropriately. In theory the viewer should be release OpenGL objects when the context is destroyed, but with GraphicsWindowEmbedded not all the standard functionality for managing OpenGL objects is available, so perhaps this step is not being executed appropriately. One thing you could try is a viewer-getSceneData()-releaseGLObjects(); osg::GLObjects::discardAllDeletedGLObjects(0); In between the viewer allocations. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgviewerQT shows garbage when viewer is destroyed and re-created
(i use qt 4.4.1 and osg 2.6, and adapted vierwerqt example sources) The QOSGWidget works for me on linux. On windows I got the pixelformat error but, I got the QOSGWidget to work, and the --CompositeViewer version, by adding the traits-setInheritedWindowPixelFormat = true; line. I don't see any problems running a second time or multiple times. I don't have any windows decorations by default, but these can also be set on. (it helps to set viewerWindow-setGeometry(50,50,640,480); instead of viewerWindow-setGeometry(0,0,640,480);) to prevent the decorations from being outside the screen. ) I did have problems when making the window heigth 0, but this was solved by making the resize always a minumum of one pixel. But i do get some errors in the console: QWidget::repaint: Recursive repaint detected and after closing: Windows Error #6: [Screen #0] GraphicsWindowWin32::makeCurrentImplementation() - Unable to set current OpenGL rendering context. Reason: De ingang is ongeldig. Windows Error #1400: [Screen #0] GraphicsWindowWin32::unregisterWindowProcedure() - Unable to unregister window procedure. Reason: Ongeldige vensteringang. I am still not sure what solution to use, as the ViewerQT version does its job, never had window problems with the AdapterWidget, but the performance of the QOSGWidget seems better. I also use a qtimer that triggers the update, but I want to start a new (singleshot) timer only after the frame is drawn, to make sure every frame is drawn before the timer issues a new frame. Large models seemed to have a problem with the original code. would there be a better solution for the update? Rene Molenaar 2008/5/7 Mathieu Champlon [EMAIL PROTECTED] Hi Robert, I quickly hacked the --QOSGWidget mode in order to work around the invalid pixel format error (forcing traits-setInheritedWindowPixelFormat = true;) and the result is the same : trashed scene on the second run. I tried adding the piece of code you suggested but it does not change anything. By the way the crash you were experiencing running with --QOSGWidget is actually due to osg::ArgumentParser modifying argv, thus on the second run argc remains unchanged but all arguments have actually been eaten up from argv. I am now using this code to run the application twice : int main( int argc, char **argv ) { char** tmp = (char**)malloc( argc * sizeof( char*) ); memcpy( tmp, argv, argc * sizeof( char* ) ); run( argc, argv ); run( argc, tmp ); } MAT. Robert Osfield wrote: Hi Mathieu, The error with -QOSGWidget looks to be a bug in this code, but its a totally different path that the default path which uses GraphicsWindowEmbedded to adapt the Viewer. QOSGWidget is the most flexible path for integration and long term I'd like this to be the default route under Qt. My own time is rather stretched out so I can't address all these things at once. The issues you are seeing with the default path is very unlikely to be related to transparency, most likely is issues with display lists or texture objects being reused inappropriately. In theory the viewer should be release OpenGL objects when the context is destroyed, but with GraphicsWindowEmbedded not all the standard functionality for managing OpenGL objects is available, so perhaps this step is not being executed appropriately. One thing you could try is a viewer-getSceneData()-releaseGLObjects(); osg::GLObjects::discardAllDeletedGLObjects(0); In between the viewer allocations. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgviewerQT shows garbage when viewer is destroyed and re-created
Hi Mathieu, I've tried your windows.ive and the suggested mods to osgviewerQT and it works fine even for running 6 viewers consecutively using osgviewerQT windows.ive, but if I add --QOSGWidget I get a crash on the second run. FYI, I'm running under Linux. What command line are you using? Robert. On Mon, May 5, 2008 at 5:18 PM, Mathieu Champlon [EMAIL PROTECTED] wrote: Hello, I'm facing a problem with the osg Qt integration on several different Windows configurations (using NVidia GF 8600 cards, on both XP and Vista), with osg 2.2.0 and osg 2.4.0. As a (short) example is better than a (long) explanation, here is how to reproduce it : 1. apply the following changes to examples/osgviewerQT/osgviewerQT.cpp (basically the goal is to run the application twice) : 36c36 int main( int argc, char **argv ) --- int run( int argc, char **argv ) 57a58,63 } int main( int argc, char **argv ) { run( argc, argv ); run( argc, argv ); 2. run examples/osgviewerQT on windows.ive (from the attached windows.zip) 3. notice the scene showing up : several window frames floating in the air 4. close the window 5. notice the trashed 'cubist' scene showing up the second time, indeed quite different from the first time I can send the texture used in the .ive if needed, can it be a problem with the way it has been created ? Any suggestion on how to investigate further ? Thanks ! MAT. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgviewerQT shows garbage when viewer is destroyed and re-created
Hello, Thanks for your reply ! I am indeed running osgviewerQT windows.ive. If I add --QOSGWidget I get this error message right away : Windows Error #2000: [Screen #0] GraphicsWindowWin32::setWindow() - Unable to create OpenGL rendering context. Reason: The pixel format is invalid. Followed by a crash (_gw is 0 in QOSGWidget::resizeEvent due to the failure to initialize properly). I'm using Qt 4 by the way, I forgot to mention it. And also I have loads of .ive working fine, this one is among the 3 or 4 which exhibit the issue. It looks like the common trait might have to do with transparency. I also tried the same test procedure with examples/osgwindows and it works fine. Moreover I just tested on a Windows XP with an (old FireGL V3100) ATI graphics card and everything works perfectly. Do you have any suggestion ? Should I just wait and hope for the next NVidia drivers ? :) Thanks ! MAT. Robert Osfield wrote: Hi Mathieu, I've tried your windows.ive and the suggested mods to osgviewerQT and it works fine even for running 6 viewers consecutively using osgviewerQT windows.ive, but if I add --QOSGWidget I get a crash on the second run. FYI, I'm running under Linux. What command line are you using? Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgviewerQT shows garbage when viewer is destroyed and re-created
Hi Mathieu, The error with -QOSGWidget looks to be a bug in this code, but its a totally different path that the default path which uses GraphicsWindowEmbedded to adapt the Viewer. QOSGWidget is the most flexible path for integration and long term I'd like this to be the default route under Qt. My own time is rather stretched out so I can't address all these things at once. The issues you are seeing with the default path is very unlikely to be related to transparency, most likely is issues with display lists or texture objects being reused inappropriately. In theory the viewer should be release OpenGL objects when the context is destroyed, but with GraphicsWindowEmbedded not all the standard functionality for managing OpenGL objects is available, so perhaps this step is not being executed appropriately. One thing you could try is a viewer-getSceneData()-releaseGLObjects(); osg::GLObjects::discardAllDeletedGLObjects(0); In between the viewer allocations. Robert. On Wed, May 7, 2008 at 11:59 AM, Mathieu Champlon [EMAIL PROTECTED] wrote: Hello, Thanks for your reply ! I am indeed running osgviewerQT windows.ive. If I add --QOSGWidget I get this error message right away : Windows Error #2000: [Screen #0] GraphicsWindowWin32::setWindow() - Unable to create OpenGL rendering context. Reason: The pixel format is invalid. Followed by a crash (_gw is 0 in QOSGWidget::resizeEvent due to the failure to initialize properly). I'm using Qt 4 by the way, I forgot to mention it. And also I have loads of .ive working fine, this one is among the 3 or 4 which exhibit the issue. It looks like the common trait might have to do with transparency. I also tried the same test procedure with examples/osgwindows and it works fine. Moreover I just tested on a Windows XP with an (old FireGL V3100) ATI graphics card and everything works perfectly. Do you have any suggestion ? Should I just wait and hope for the next NVidia drivers ? :) Thanks ! MAT. Robert Osfield wrote: Hi Mathieu, I've tried your windows.ive and the suggested mods to osgviewerQT and it works fine even for running 6 viewers consecutively using osgviewerQT windows.ive, but if I add --QOSGWidget I get a crash on the second run. FYI, I'm running under Linux. What command line are you using? Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgviewerQT shows garbage when viewer is destroyed and re-created
Hi Robert, I quickly hacked the --QOSGWidget mode in order to work around the invalid pixel format error (forcing traits-setInheritedWindowPixelFormat = true;) and the result is the same : trashed scene on the second run. I tried adding the piece of code you suggested but it does not change anything. By the way the crash you were experiencing running with --QOSGWidget is actually due to osg::ArgumentParser modifying argv, thus on the second run argc remains unchanged but all arguments have actually been eaten up from argv. I am now using this code to run the application twice : int main( int argc, char **argv ) { char** tmp = (char**)malloc( argc * sizeof( char*) ); memcpy( tmp, argv, argc * sizeof( char* ) ); run( argc, argv ); run( argc, tmp ); } MAT. Robert Osfield wrote: Hi Mathieu, The error with -QOSGWidget looks to be a bug in this code, but its a totally different path that the default path which uses GraphicsWindowEmbedded to adapt the Viewer. QOSGWidget is the most flexible path for integration and long term I'd like this to be the default route under Qt. My own time is rather stretched out so I can't address all these things at once. The issues you are seeing with the default path is very unlikely to be related to transparency, most likely is issues with display lists or texture objects being reused inappropriately. In theory the viewer should be release OpenGL objects when the context is destroyed, but with GraphicsWindowEmbedded not all the standard functionality for managing OpenGL objects is available, so perhaps this step is not being executed appropriately. One thing you could try is a viewer-getSceneData()-releaseGLObjects(); osg::GLObjects::discardAllDeletedGLObjects(0); In between the viewer allocations. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org