[osg-users] OSG is unable to create 3.3 core profile context

Ashley Nielsen wyvernventures at gmail.com
Sat Jul 22 09:21:41 PDT 2017


I require an OpenGL 3.3 core profile (not compatibility profile) for my application. I've used a previous framework that was able to successfully compile "#version 330 core" shaders, however, OSG doesn't appear to support core profile. 

I use the following code to set up my OpenGL context:

Code:

        osg::ref_ptr< osg::GraphicsContext::Traits > traits = new osg::GraphicsContext::Traits();
        traits->x = 20;
        traits->y = 30;
        traits->width = width;
        traits->height = height;
        traits->windowDecoration = true;
        traits->doubleBuffer = true;
        traits->windowName = "ne0ndrag0n area51 OSG evaluation";
        traits->glContextVersion = "3.3";
        traits->glContextProfileMask = 0;

        contextHelper = osg::GraphicsContext::createGraphicsContext( traits.get() );
        if( !contextHelper.valid() ) {
          throw FailedContextException();
        }




The context is unable to detect GLSL 3.30 is supported by the hardware:

Code:

FRAGMENT glCompileShader "" FAILED
FRAGMENT Shader "" 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

VERTEX glCompileShader "" FAILED
VERTEX Shader "" 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




Despite the fact that it is (glxinfo output):

Code:

server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
    Max core profile version: 4.5
    Max compat profile version: 3.0
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.1
OpenGL core profile version string: 4.5 (Core Profile) Mesa 17.0.3
OpenGL core profile shading language version string: 4.50
OpenGL version string: 3.0 Mesa 17.0.3
OpenGL shading language version string: 1.30
OpenGL ES profile version string: OpenGL ES 3.1 Mesa 17.0.3
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10




Is there a context option I'm missing?

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=71303#71303







More information about the osg-users mailing list