[osg-users] Issues with Qt based application and occulusion queries

Daniel Trstenjak daniel.trstenjak at gmail.com
Mon Feb 26 07:12:30 PST 2018


the issue is, that if the qt application window is minimized, then
the occlusion queries always return 0 as the number of passed pixels.

I don't think that this is an OpenSceneGraph issue, but I'm hoping to get
some hints here what the reasons of the issue might be, because at the
moment I'm pretty much out of ideas.

We're having a Qt based application, a QGLWidget for the rendering area and
using a 'osgUtil::SceneView' for the rendering of the scene.

For the occlusion queries we don't use OpenSceneGraph functionality, but
directly use the OpenGL extensions GL_NV_occlusion_query or GL_ARB_occlusion_query.
Both extensions behave in the same way for this case.

An application session can be recorded into a script - which might also
include taking snapshots of the 3d scene - and the script can be
executed afterwards and should produce the same snapshots.

The application has a "no gui" mode, which runs the application with a
minimized qt window and is mostly used for the script execution. Now
everything regarding snapshots works in the "no gui" mode, beside of
the occlusion queries, which always return 0 as the number of passed pixels.

Now we also have a "no display" mode of the application, to be able to
run scripts on servers without graphics hardware, by using the Mesa
OpenGL library, and in this case the occlusion queries work like expected.
The biggest difference on the Qt side in this case seems to be that the
instanciated QApplication is of type TTY.

It's also possible to run the version using the Mesa library in "no gui"
mode, in which case I'm getting yet another result, the occlusion query
then returns some passed pixels, but the result is wrong.

At the moment I'm pretty much perplexed how I should interpret these
different results and I could reproduce them on different linux machines
with different graphics cards and drivers.

We're using at the moment OpenSceneGraph-3.0.1 and Qt-4.6.3 (we're
porting to Qt-5.9.4, which gives the same results).

My local machine:
System: Ubuntu 16.04
Graphics Card: GeForce GTX 970
Driver: NVIDIA 375.39

I greatly appreciate any kind of ideas what might be the issue here.



More information about the osg-users mailing list