Re: [osg-users] Migration from OSG 3.1.5 to 3.4.0 / Qt 4 to Qt 5
Ok, now I am having a new problem. I am now transitioning to QT 5.5 and Visual Studio 2015 Update 1 from QT 5.4 and VS 2010 ( using OSG 3.4.0) I rebuilt OSG for Visual Studio 2015 Update 1 I built QT5.5 for Visual Studio 2015 Update 1 The OSG examples all work fine, except OSGViewerQT When osgViewerQT starts up > osg130-osgd.dll!osg::State::initializeExtensionProcs() Line 959 C++ osg130-osgd.dll!osg::GraphicsContext::makeCurrent() Line 620C++ osg130-osgQtd.dll!osgQt::GraphicsWindowQt::realizeImplementation() Line 777 C++ osg130-osgd.dll!osg::GraphicsContext::realize() Line 511C++ osg130-osgViewerd.dll!osgViewer::CompositeViewer::realize() Line 612 C++ osg130-osgViewerd.dll!osgViewer::ViewerBase::frame(double simulationTime) Line 681 C++ osgviewerQtd.exe!ViewerWidget::paintEvent(QPaintEvent * event) Line 85 C++ const char* vendor = (const char*) glGetString( GL_VENDOR ); returns NULL, so of course nothing will work from now on. Digging through the code, I found that in QGLContext::makeCurrent > Qt5OpenGLd.dll!QGLContext::makeCurrent() Line 3578 C++ Qt5OpenGLd.dll!QGLWidget::makeCurrent() Line 4071 C++ osg130-osgQtd.dll!osgQt::GraphicsWindowQt::makeCurrentImplementation() Line 840 C++ osg130-osgd.dll!osg::GraphicsContext::makeCurrent() Line 611C++ osg130-osgQtd.dll!osgQt::GraphicsWindowQt::realizeImplementation() Line 777 C++ osg130-osgd.dll!osg::GraphicsContext::realize() Line 511C++ const char *renderer = reinterpret_cast(d->guiGlContext->functions()->glGetString(GL_RENDERER)); returns a valid string... Any ideas on this one? It looks like we do not have a valid GL context when OSG needs it. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=65981#65981 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Migration from OSG 3.1.5 to 3.4.0 / Qt 4 to Qt 5
I see my error, I built QT 5.5 with OpenGL ES 2 support, not desktop OpenGL support. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=65982#65982 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Migration from OSG 3.1.5 to 3.4.0 / Qt 4 to Qt 5
HI Andrew The issue revolves around the default osg::Camera constructing without a StateSet, in this default state it doesn't set any state when you attach it to a Viewer. It leaves the responsibility up to you as the developer to set up the state which is appropriate for your viewer. Prior to OSG-3.2 a bug in osgUtil::SceneView overridded the state set by the viewer's Camera adding in it's own global settings - this meant you couldn't set your own which is the bug, but had a side affect of hiding the lack of set global state by adding in some defaults, so your application looked like it was fine even though it wasn't setting state that it should have been doing. The View(er) itself has osg::Camera and by default it sets up Camera StateSet with with some defaults appropriate for viewer by calling StateSet::setGlobalDefaults(). This means that by default the viewer actually enables depth test etc. However, if you replace the View(er) Camera's without your own without the state set up in a similar way it breaks. The original Qt example replaced the Camera and didn't set up state so if you ported it to OSG-3.2 or later it. In Qt and other examples in OSG-3.2 and later the View's Camera is used directly rather than assigned a new one. If you still want to assign your own Camera (something this is actually unnecessary) you should set up the global state that you want, sensible defaults for a 3d viewer are set up by: view.getCamera()->getOrCreateStateSet()->setGlobalDefaults(); If you don't do this then you application will be using OpenGL defaults. Robert. On 4 January 2016 at 22:57, Andrew Cunninghamwrote: > [quote="robertosfield"]Hi Andrew > The reason why z buffer etc. Is off is the your setup hasn't set it up as > there is no global stateset to the camera you are passing to the Viewer. > I have discussed this topic quite a but since OSG-3.2. Please see the > archives. > Robert. [quote] > > OK thanks, but my forum searching did not turn up much on this topic. Wrong > keywords I suppose. > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=65940#65940 > > > > > > ___ > 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] Migration from OSG 3.1.5 to 3.4.0 / Qt 4 to Qt 5
Hi Andrew The reason why z buffer etc. Is off is the your setup hasn't set it up as there is no global stateset to the camera you are passing to the Viewer. I have discussed this topic quite a but since OSG-3.2. Please see the archives. Robert. On 4 Jan 2016 10:02 pm, "Andrew Cunningham"wrote: > Hi, > Although I now have rendering of my objects happening in my Qt5/OSG 3.4.0 > widget I am having a issue with simple polygonal objects rendering "on top > of each other" as if there is no depth (Z) buffer in operation. I am using > fairly vanilla OSG code to set up the model and camera that worked as > expected in a MFC/OSG 3.0.1 world. > > I am completely at a loss as to why a Z-buffer is not operating. GL_BLEND > is definitively OFF. > > Any ideas? > Thanks! > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=65937#65937 > > > > > > ___ > 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] Migration from OSG 3.1.5 to 3.4.0 / Qt 4 to Qt 5
[quote="robertosfield"]Hi Andrew The reason why z buffer etc. Is off is the your setup hasn't set it up as there is no global stateset to the camera you are passing to the Viewer. I have discussed this topic quite a but since OSG-3.2. Please see the archives. Robert. [quote] OK thanks, but my forum searching did not turn up much on this topic. Wrong keywords I suppose. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=65940#65940 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Migration from OSG 3.1.5 to 3.4.0 / Qt 4 to Qt 5
Hmm, I was able to fix it by adding the following to my root object state... state->setMode( GL_DEPTH_TEST, osg::StateAttribute::ON ); Not sure why this was needed in QT5/OSG as I thought it was the default... -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=65939#65939 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Migration from OSG 3.1.5 to 3.4.0 / Qt 4 to Qt 5
Hi, Although I now have rendering of my objects happening in my Qt5/OSG 3.4.0 widget I am having a issue with simple polygonal objects rendering "on top of each other" as if there is no depth (Z) buffer in operation. I am using fairly vanilla OSG code to set up the model and camera that worked as expected in a MFC/OSG 3.0.1 world. I am completely at a loss as to why a Z-buffer is not operating. GL_BLEND is definitively OFF. Any ideas? Thanks! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=65937#65937 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Migration from OSG 3.1.5 to 3.4.0 / Qt 4 to Qt 5
I'm not 100% sure why the OSG example code stopped rendering correctly when embedded in my app as a test. I did get it working eventually. Anyway, the underlying issue when trying to adapt the new OSG3.4/QT5 approach into my code code was that I completely missed ( too much holiday cheer?) that the 'actual' widget being rendered is found in graphicsWindow_->getGLWidget(). -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=65932#65932 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Migration from OSG 3.1.5 to 3.4.0 / Qt 4 to Qt 5
What was the issue? On December 31, 2015 11:36:23 AM PST, Andrew Cunninghamwrote: > >loopy wrote: >> Hi, >> I am struggling mightily to get OSG 3.4.0 to work with QT 5.4.2 on >Windows 7 (64). >> >> - The sample application, OSGViewerQT works as expected with >OSG_FILE_PATH set. >> >> - However, when I ( as a quick test) embed the "ViewerWidget" from >OSGViewerQT inside a QHBoxLayout inside a MainWindow, the ViewerWidget >does not show any geometry ( e.g. the "cow.osgt" etc). Interestingly >the "popupWidget" that displays the "truck" geometry works as expected >- presumably as it is a separate Window. So there is some issue with >embedding the OSG Widget(s) inside other QWidgets? >> >> > > >OK, I sorted this one out. It was confusion over 'old ways' to use >OSG/QT and the new, improved ways to do this. > >-- >Read this topic online here: >http://forum.openscenegraph.org/viewtopic.php?p=65929#65929 > > > > > >___ >osg-users mailing list >osg-users@lists.openscenegraph.org >http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Sent from my phone. Please excuse my brevity.___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Migration from OSG 3.1.5 to 3.4.0 / Qt 4 to Qt 5
loopy wrote: > Hi, > I am struggling mightily to get OSG 3.4.0 to work with QT 5.4.2 on Windows 7 > (64). > > - The sample application, OSGViewerQT works as expected with OSG_FILE_PATH > set. > > - However, when I ( as a quick test) embed the "ViewerWidget" from > OSGViewerQT inside a QHBoxLayout inside a MainWindow, the ViewerWidget does > not show any geometry ( e.g. the "cow.osgt" etc). Interestingly the > "popupWidget" that displays the "truck" geometry works as expected - > presumably as it is a separate Window. So there is some issue with embedding > the OSG Widget(s) inside other QWidgets? > > OK, I sorted this one out. It was confusion over 'old ways' to use OSG/QT and the new, improved ways to do this. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=65929#65929 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Migration from OSG 3.1.5 to 3.4.0 / Qt 4 to Qt 5
Hi, I am struggling mightily to get OSG 3.4.0 to work with QT 5.4.2 on Windows 7 (64). - The sample application, OSGViewerQT works as expected with OSG_FILE_PATH set. - However, when I ( as a quick test) embed the "ViewerWidget" from OSGViewerQT inside a QHBoxLayout inside a MainWindow, the ViewerWidget does not show any geometry ( e.g. the "cow.osgt" etc). Interestingly the "popupWidget" that displays the "truck" geometry works as expected - presumably as it is a separate Window. So there is some issue with embedding the OSG Widget(s) inside other QWidgets? Any ideas??? Cheers, Andrew -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=65928#65928 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Migration from OSG 3.1.5 to 3.4.0 / Qt 4 to Qt 5
After a long investigation, it seems the way the camera was initialized was not working anymore. It was a bit painful that no error were raised, just this weird black background. But starting from the example and tuning our code worked at the end ! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=65888#65888 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Migration from OSG 3.1.5 to 3.4.0 / Qt 4 to Qt 5
On 17 December 2015 at 15:29, Emmanuel Potwrote: > After a long investigation, it seems the way the camera was initialized > was not working anymore. It was a bit painful that no error were raised, > just this weird black background. But starting from the example and tuning > our code worked at the end ! Good to hear you've track the issue down. It's a shame you didn't upgrade a bit sooner as there was several discussions about a bug fix to the core OSG that paradoxically caused problems with applications that had erroneous camera set up code - basically the original bug in the core OSG hid this erroneous camera set up so fixing it ravelled the problem. The original osgviewerQt example had to error in the Camera set up code. The fix was actually part of OSG-3.2, so OSG-3.4 inherited it. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Migration from OSG 3.1.5 to 3.4.0 / Qt 4 to Qt 5
What I notice is really really weird: if I do not put anything as sceneData, then the rendering is buggy (black background and ugly text). But if I put anything, even a simple box or text, then it is fine. I am not sure I understand what can "corrupt" somehow the StatsHandler, nor why it only occurs with Qt. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=65881#65881 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Migration from OSG 3.1.5 to 3.4.0 / Qt 4 to Qt 5
Ah ! You saved me :-) !! I was not exporting the OSG_FILE_PATH variable because I did not really care about the models themselves, but it looks like it is finding some configuration for the text rendering and the background over there... I will start investigating what it really needs in there (which was not the case for OSG 3.1.5). -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=65876#65876 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Migration from OSG 3.1.5 to 3.4.0 / Qt 4 to Qt 5
I got an email from the osg users mailing list, but I cannot answer to it :-(. I was told that the osgviewerqt was working fine on someone else machine. On my side, I get a black background when pressing s, whereas it was transparent before. I have no idea what to do :-(. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=65872#65872 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Migration from OSG 3.1.5 to 3.4.0 / Qt 4 to Qt 5
After a quick check, it seems that if I get the same issues with OSG 3.5.1. And if I build OSG 3.5.1 against Qt4 (4.8.6 to be accurate), I get the same issues in the viewerqt. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=65849#65849 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org