Cannot render and load OBJ when using QOpenGLWidget with osgViewer::GraphicsWindowEmbedded on OSG 3.5.6 rc2 and 3.6.4

64 views
Skip to first unread message

mohamed selim

unread,
Jan 30, 2020, 8:59:08 AM1/30/20
to osg-...@googlegroups.com
When using QOpenGLWidget with osgViewer::GraphicsWindowEmbedded to render and load OBJ file nothing is being rendered, I am using latest osg 3.6.5 rc2 on ubuntu 19.10 with Inel graphics Card hd 620 using Mesa 19.3. When I create a passive osgViewer::GraphicsWindowEmbedded along QOpenGLWidget to render any geometrical shapes using normal osg::ShapeDrawable and osg Geode and it works fine, if I use osgDB::readNodeFile instead to load mesh objects using STL formats it does also work fine, but if I opt for OBJ format, it won't render anything I am attaching a working example.

I am extending a QOpenGLWidget using... class QtOSGWidget : public QOpenGLWidget and overriding necessary virtual functions and having normal passive osg embedded viewer withing QOpenGLWidget. The strange thing this workflow works for me without a problem on windows 10, what's more stranger if I opt for normal osgViewer::Viewer without the Qt QOpenGLWidget it works fine and loads and renders the obj file perfectly.

I've attached debug output of osg using OSG_NOTIFY_LEVEL set to DEBUG. I am using Qt 5.14 and I also tried Qt 5.12, 5.9 and 5.7 and I got the same result.
Also using Qt Creator 4.11, also I discovered that when I launch the application using the debugger right from Qt creator I would be able to render it normally, if I launch the application normally without Qt creator's debugger nothing is rendered, same result with release and debug and also launching application from bash cmd line.

I would like to draw the attention to the fact that the OBJ sounds normal tried it with osg 3.6.5 rc2 and 3.6.4 on windows and above scenario works fine, no problem with location obj file or anything like that. I believe that the problem is coupled only with QOpenGLWidget and osgViewer::GraphicsWindowEmbedded to load OBJ file(only) on linux (ubuntu 19.10, xubunu 18.10).
Tested on:
- Linux Ubuntu 19.10
- Xubuntu 18.10
- Intel HD 620 graphics
- Mesa 19.2 and latest 19.3
- Qt 5.14, Qt 5.13
- Qt Creator 4.11
- CMake 3.16
- OSG 3.6.5 rc2 and 3.6.4

doesntwork.txt
osgQt.zip
works.txt

OpenSceneGraph Users

unread,
Jan 30, 2020, 9:49:22 AM1/30/20
to OpenSceneGraph Users
Hi Mohamed,
there seems to be a difference in options between "works.txt" and "doesntwork.txt",
doesntwork seems to run with "noTriStripPolygons" option, NOT generating a message "VertexCacheVisitor searching all triangles"

Laurens.




On Thu, Jan 30, 2020 at 2:59 PM OpenSceneGraph Users <osg-...@lists.openscenegraph.org> wrote:
When using QOpenGLWidget with osgViewer::GraphicsWindowEmbedded to render and load OBJ file nothing is being rendered, I am using latest osg 3.6.5 rc2 on ubuntu 19.10 with Inel graphics Card hd 620 using Mesa 19.3. When I create a passive osgViewer::GraphicsWindowEmbedded along QOpenGLWidget to render any geometrical shapes using normal osg::ShapeDrawable and osg Geode and it works fine, if I use osgDB::readNodeFile instead to load mesh objects using STL formats it works fine, but if I opt for OBJ format, it won't render anything I am attaching a working example


I am extending a QOpenGLWidget using... class QtOSGWidget : public QOpenGLWidget and ovveriding necessary virtual functions and having normal passive osg embedded viewer withing QOpenGLWidget. The strange thing this workflow works for me without a problem on windows 10, what's more stranger if I opt for normal osgViewer::Viewer without the Qt QOpenGLWidget it works fine and loads and renders the obj file perfectly.

I've attached debug output of osg using OSG_NOTIFY_LEVEL set to DEBUG. I am using Qt 5.14 and I also tried Qt 5.12, 5.9 and 5.7 and I got the same result.
Also using Qt Creator 4.11, also I discovered that when I launch the application using the debugger right from Qt creator I would be able to render it normally, if I launch the application normally without Qt creator's debugger nothing is rendered, same result with release and debug and also launching application from bash cmd line.

I would like to draw the attention to the fact that the OBJ sounds normal tried it with osg 3.6.5 rc2 and 3.6.4 on windows and above scenario works fine, no problem with location obj file or anything like that. I believe that the problem is coupled only with QOpenGLWidget and osgViewer::GraphicsWindowEmbedded to load OBJ file(only) on linux (ubuntu 19.10, xubunu 18.10).

--
You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osg-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osg-users/43a9d8de-b692-4046-bb9f-3645cae0204c%40googlegroups.com.
_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

mohamed selim

unread,
Jan 30, 2020, 10:00:19 AM1/30/20
to OpenSceneGraph Users
Hi Laurens,
thanks for the reply, I've noticed that also, that mean the Qt creator along with is triggering something (OpenGL related maybe) that in turns triggers this option switch in both cases.


On Thursday, January 30, 2020 at 3:49:22 PM UTC+1, OpenSceneGraph Users wrote:
Hi Mohamed,
there seems to be a difference in options between "works.txt" and "doesntwork.txt",
doesntwork seems to run with "noTriStripPolygons" option, NOT generating a message "VertexCacheVisitor searching all triangles"

Laurens.




On Thu, Jan 30, 2020 at 2:59 PM OpenSceneGraph Users <osg-...@lists.openscenegraph.org> wrote:
When using QOpenGLWidget with osgViewer::GraphicsWindowEmbedded to render and load OBJ file nothing is being rendered, I am using latest osg 3.6.5 rc2 on ubuntu 19.10 with Inel graphics Card hd 620 using Mesa 19.3. When I create a passive osgViewer::GraphicsWindowEmbedded along QOpenGLWidget to render any geometrical shapes using normal osg::ShapeDrawable and osg Geode and it works fine, if I use osgDB::readNodeFile instead to load mesh objects using STL formats it works fine, but if I opt for OBJ format, it won't render anything I am attaching a working example


I am extending a QOpenGLWidget using... class QtOSGWidget : public QOpenGLWidget and ovveriding necessary virtual functions and having normal passive osg embedded viewer withing QOpenGLWidget. The strange thing this workflow works for me without a problem on windows 10, what's more stranger if I opt for normal osgViewer::Viewer without the Qt QOpenGLWidget it works fine and loads and renders the obj file perfectly.

I've attached debug output of osg using OSG_NOTIFY_LEVEL set to DEBUG. I am using Qt 5.14 and I also tried Qt 5.12, 5.9 and 5.7 and I got the same result.
Also using Qt Creator 4.11, also I discovered that when I launch the application using the debugger right from Qt creator I would be able to render it normally, if I launch the application normally without Qt creator's debugger nothing is rendered, same result with release and debug and also launching application from bash cmd line.

I would like to draw the attention to the fact that the OBJ sounds normal tried it with osg 3.6.5 rc2 and 3.6.4 on windows and above scenario works fine, no problem with location obj file or anything like that. I believe that the problem is coupled only with QOpenGLWidget and osgViewer::GraphicsWindowEmbedded to load OBJ file(only) on linux (ubuntu 19.10, xubunu 18.10).

--
You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osg-...@googlegroups.com.

mohamed selim

unread,
Jan 30, 2020, 11:06:37 AM1/30/20
to OpenSceneGraph Users
 
Hi  laurens,
I've tried osgDB::Options("noTriStripPolygons")
and now I can see
VertexCacheVisitor searching all triangles
but nothing is rendered.

OpenSceneGraph Users

unread,
Jan 30, 2020, 11:40:51 AM1/30/20
to OpenSceneGraph Users
Maybe you can try to write out the Node to .osgt just after you read it, and compare the result between the working and non working version.
Also to try: write out the options string; maybe other options have changed as well?
The change in options suggests that you are somehow running different code, or have different environment settings (OSG_OPTIMIZER=OFF maybe?).
I know very little about Qt and cannot reproduce your problem, I can do little more than provide hints for you to search on.
Laurens.

--
You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osg-users+...@googlegroups.com.

mohamed selim

unread,
Jan 30, 2020, 11:50:37 AM1/30/20
to OpenSceneGraph Users
I will try, but I doubt it would be of insight, I am not running two different code, it's just launching the application using debugger or without (that's it), with the debugger application always is able to render the obj file, otherwise nothing is rendered.


On Thursday, January 30, 2020 at 5:40:51 PM UTC+1, OpenSceneGraph Users wrote:
Maybe you can try to write out the Node to .osgt just after you read it, and compare the result between the working and non working version.
Also to try: write out the options string; maybe other options have changed as well?
The change in options suggests that you are somehow running different code, or have different environment settings (OSG_OPTIMIZER=OFF maybe?).
I know very little about Qt and cannot reproduce your problem, I can do little more than provide hints for you to search on.
Laurens.

On Thu, Jan 30, 2020 at 5:07 PM OpenSceneGraph Users <osg-...@lists.openscenegraph.org> wrote:
 
Hi  laurens,
I've tried osgDB::Options("noTriStripPolygons")
and now I can see
VertexCacheVisitor searching all triangles
but nothing is rendered.

--
You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osg-...@googlegroups.com.

mohamed selim

unread,
Feb 4, 2020, 8:10:51 AM2/4/20
to OpenSceneGraph Users
HI,
I've tried to export the scene to osgt file and I found that it writes the structure of the node i.e. Geode s Geometries vertexes colors..etc. but the with all values set to zero. That's why they're not seen.
Reply all
Reply to author
Forward
0 new messages