Linux: osgEarth & OpenGL CoreProfile

As mentioned in the previous post you have to build OSG for OpenGL Core Profile on an machine with an Intel GPU.

The main aim of these series of posts is to get osgEarth working with Qt and OpenGL CoreProfile.

The first step is to get osgEarth working with CoreProfile.

It turns out that the following is required:

osg::DisplaySettings::instance()->setGLContextVersion("4.5");


I added this to to example 'osgearth_drawables' to check that this worked.

If you don't add the above you get the following type of errors:

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


As it is you will still get the following:

Warning: detected OpenGL error 'invalid enumerant' at after RenderBin::draw(..)

In addition to the above the following is required for GL3/CoreProfile:

// Sets up the State for GL3 mode
viewer.setRealizeOperation(new GL3RealizeOperation());


Note: osgEarth has some code that is conditionally compiled if OSG_GL3_AVAILABLE or OSG_GL4_AVAILABLE is defined. The defines are pulled in from the OSG header 'GL'.

Comments