osgearth_qt_simple issue

classic Classic list List threaded Threaded
4 messages Options
jeladi jeladi
Reply | Threaded
Open this post in threaded view
|

osgearth_qt_simple issue

When I try to run the osgearth_qt_simple example from osgEarth 2.8 I get the following output:

VERTEX glCompileShader "main(vertex)" FAILED
VERTEX Shader "main(vertex)" infolog:
0:1(10): error: GLSL 3.30 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, and 3.00 ES

glLinkProgram "" FAILED
Program "" infolog:
error: linking with uncompiled/unspecialized shader
VERTEX glCompileShader "oe_mp_vertModel" FAILED
VERTEX Shader "oe_mp_vertModel" infolog:
0:1(10): error: GLSL 3.30 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, and 3.00 ES

VERTEX glCompileShader "main(vertex)" FAILED
VERTEX Shader "main(vertex)" infolog:
0:1(10): error: GLSL 3.30 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, and 3.00 ES

glLinkProgram "osgEarth.engine_mp.TerrainNode" FAILED
Program "osgEarth.engine_mp.TerrainNode" infolog:
error: linking with uncompiled/unspecialized shadererror: linking with uncompiled/unspecialized shader

However, when I do a 'glxinfo | grep version' I get:

server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
    Max core profile version: 4.2
    Max compat profile version: 3.0
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.0
OpenGL core profile version string: 4.2 (Core Profile) Mesa 20.1.5
OpenGL core profile shading language version string: 4.20
OpenGL version string: 3.0 Mesa 20.1.5
OpenGL shading language version string: 1.30
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 20.1.5
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00

Why does the example think that GLSL 3.30 is not supported when my video card can handle a higher version than that as far as the core profile is concerned?  Could it be something in my OSG or osgEarth build settings?  I am building with Qt 5.14.2 on Fedora 32 with OpenSceneGraph 3.4.0 and osgEarth 2.8.
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: osgearth_qt_simple issue

Memory is hazy, but you may need to use one or more of the Mesa GL env vars like MESA_GL_VERSION_OVERRIDE. Check the Mesa docs for details.
Glenn Waldron / Pelican Mapping
jeladi jeladi
Reply | Threaded
Open this post in threaded view
|

Re: osgearth_qt_simple issue

Thanks for the info. Setting MESA_GL_VERSION_OVERRIDE only worked partially on Fedora.  It got rid of most of the console errors but would sometimes crash.  I switched to Pop!_OS and had better results.  I still have to set the MESA_GL_VERSION_OVERRIDE to avoid errors but the example runs cleanly now.  My own osgEarth-based application mostly works but the sky layer from the earth file will not load.  That is a problem I can live with for the time being.  I didn't start having these issues until Mesa started supporting OpenGL 4.2 on my ancient hardware (Intel HD 4000) so I guess something happened either in Mesa or Qt that nerfed my machine.
DamianDixon DamianDixon
Reply | Threaded
Open this post in threaded view
|

Re: osgearth_qt_simple issue

The issue is a combination of Qt, Mesa Intel i965 driver and OSG.

The primary issue is that the Intel Mesa drivers only have Core profile and no legacy support after a certain OpenGL/Mesa version (can't remember exact details).

So to deal with this I normally build OSG and osgEarth with OPENGL_PROFILE=GLCORE.

With Qt I set the version of OpenGL to use:

  QGLFormat format ( QGLFormat::defaultFormat() );
  format.setVersion( 4, 5 );
  format.setProfile( QGLFormat::CoreProfile ); // Requires >=Qt-4.8.0
  format.setDepthBufferSize( 24 );
  format.setGreenBufferSize( 8 );
  format.setBlueBufferSize( 8 );
  format.setRedBufferSize( 8 );
  format.setAlphaBufferSize( 8 );
  //format.setSamples( 0 );

  format.setAlpha( true );
  format.setDepth( true );
  format.setStencil( false );
  format.setDoubleBuffer( true );
  format.setSwapInterval( 1 ); // v-sync on
  format.setStereo( false );
  format.setSampleBuffers( true );

The other environment variable to probably set too is:

  export OSG_GL_VERSION="4.5"

I'm currently using osgEarth 2.10, OSG 3.6.3, Qt 5.14.2.

The OSG Qt version is a bit of a mess and the whole use of Qt needs a different approach.

I keep meaning to re-write my applications to render OSG/osgEarth to an offscreen texture and to display the texture using Qt3D. That way you can have a degree of seperation between OSG/osgEarth and Qt as well as use different OpenGL contexts.