[osg-users] glsl version 130 not supported (and related problems)

Robert Osfield robert.osfield at gmail.com
Mon Oct 24 01:04:54 PDT 2016

Hi Bruno,

Apple have made life difficult for OpenGL developers in the way they
have tackled modern OpenGL support so it tends to be awkward and
behind the curve on latest features.  It's the Apple way to mess
developers around though, unfortunately you just have accept the rough
with the smooth under OSX if you want to support it.  Personally I
wouldn't recommend OSX for OpenGL these days, so if you have choice
then Windows or Linux will likely lead to an easier life.

On the OSX front if you want to use the latest GL features you are
forced to use OpenGL core profile and dump all the backwards
compatibility support the other platforms provide.  So have to build
the OSG with the just the core profile enabled and fixed function
disabled, you'll also need to use the latest OSG dev work (master is
probably best) as it includes the VAO support you'll need.  The OSG
CMake system has an OPENGL_PROFILE var that you can set to GL3 or


If you are have already built the OSG then you'll want to remove the
previous CMakeCache.txt to make sure the CMake runs all setup afresh.

Once the OSG has been set up then you'll need to enable Vertex Array
Object usage by setting the osg::DisplaySetting::setVertexBufferHint()
with VERTEX_ARRAY_OBJECT prior to setting up the viewer i.e.


osgViewer:Viewer viewer(..).

Or set the default value via the OSG_VERTEX_BUFFER_HINT to VERTEX_ARRAY_OBJECT.

Once the VAO work is more widely tested and debugged setting the VAO
hint on by default should be possible, but for now it's still a manual

I realise this is a bit of pain, but that's down to the games that
Apple plays, provides sub par support and in a manner of it's choosing
not the type of solution that best fits the needs of developers.


More information about the osg-users mailing list