Intel GPU: Building OSG and osgEarth for Core Profile

The Intel GPU drivers for Mesa now support OpenGL 4.4 at least.

However for OpenGL 3.1 and newer only the Core Profile is supported. This means you can not use the old style OpenGL calls at all.

There are two approaches to getting osgEarth working in this environment:

Use an Old version of OSG and osgEarth.

This means that the earliest version of osgEarth to use is 2.7, with OSG 3.4.x.

osgEarth 2.8 uses GLSL shaders with version 330. Which means OpenGL 3.3 at least.

You can not specify a Core profile with compatibility enabled for Intel GPUs on Linux. This is pretty much the same approach that Apple have taken with their OpenGL on macOS

Some small modifications will be required to build OSG and osgEarth on Ubuntu 18.04. RTT picking will not work with this version of osgEarth, the shader is broken. The Mesa Intel driver is very strict.

Build OSG for Core Profile

Which while is sounds an easy thing to do, was not so simple in practice, at least not until I figured out what I was doing wrong.

The cmake command line is:

cmake ../OpenSceneGraph -DOPENGL_PROFILE=GLCORE -DCMAKE_PREFIX_PATH=/opt/Qt/5.6.3/gcc_64/lib/cmake

The mistake I originally made was to set the OPENGL_PROFILE using ccmake which meant that I kept missing something important.

Note:

Qt samples will not workout of the box as Core Profile will not be automatically setup.


Comments