OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

OSG is unable to create 3.3 core profile context


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
ne0ndrag0n
Newbie


Joined: 22 Jul 2017
Posts: 3

PostPosted: Sat Jul 22, 2017 4:21 pm    Post subject:
OSG is unable to create 3.3 core profile context
Reply with quote

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?
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11275

PostPosted: Sun Jul 23, 2017 8:15 am    Post subject:
OSG is unable to create 3.3 core profile context
Reply with quote

Hi Ahsley,


What OS, GL drivers, OSG version and hardware are you using?


Robert.

------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
ne0ndrag0n
Newbie


Joined: 22 Jul 2017
Posts: 3

PostPosted: Sun Jul 23, 2017 12:47 pm    Post subject:
Re: OSG is unable to create 3.3 core profile context
Reply with quote

robertosfield wrote:
Hi Ahsley,


What OS, GL drivers, OSG version and hardware are you using?


Robert.

------------------
Post generated by Mail2Forum



OS: Ubuntu 17.04
GL drivers: as reported by glxinfo
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

OSG version: Git HEAD 0b5f45289d1c4b2de7e2e29380a1e0a3f92ac79e (Mon Jun 19 15:55:42 2017 +0100)
Hardware: Here is the output of lshw -c video, showing Radeon HD 8870M with the open-source radeon driver:
Code:

  *-display                 
       description: VGA compatible controller
       product: Venus XT [Radeon HD 8870M / R9 M270X/M370X]
       vendor: Advanced Micro Devices, Inc. [AMD/ATI]
       physical id: 0
       bus info: pci@0000:01:00.0
       version: 00
       width: 64 bits
       clock: 33MHz
       capabilities: pm pciexpress msi vga_controller bus_master cap_list rom
       configuration: driver=radeon latency=0
       resources: irq:28 memory:e0000000-efffffff memory:f7e00000-f7e3ffff ioport:e000(size=256) memory:c0000-dffff


The same code, unmodified, does work fine on my desktop with an Nvidia GTX 570 using the proprietary nv drivers. I can't confirm until I get back home tonight, but it looks like my desktop supports compatibility profile for version 330 shaders, while this laptop does not, as glxinfo on the laptop shows compatibility profile supports a max shader version of 130 and GL version 3.0. I mention this because it appears when using Linux/GraphicsWindowX11, OSG creates a compatibility profile if the programmer requests or intends to create a core profile. Is this intentional? Looking at line 820 in GraphicsWindowX11, I think this line might be creating the maximum compatibility profile, and "glXCreateContextAttribsARB" may be required to create core profile contexts if requested by the developer. Around line 1873 of GraphicsWindowWin32, it appears "glContextVersion" is parsed and the (Windows) ARB method is used.
Back to top
View user's profile Send private message
mp3butcher (Julien Valentin)
Appreciator


Joined: 17 Feb 2010
Posts: 349

PostPosted: Sun Jul 23, 2017 4:00 pm    Post subject:
Re: OSG is unable to create 3.3 core profile context
Reply with quote

Is example osgsimplegl3 working?


ne0ndrag0n wrote:
robertosfield wrote:
Hi Ahsley,


What OS, GL drivers, OSG version and hardware are you using?


Robert.

------------------
Post generated by Mail2Forum



OS: Ubuntu 17.04
GL drivers: as reported by glxinfo
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

OSG version: Git HEAD 0b5f45289d1c4b2de7e2e29380a1e0a3f92ac79e (Mon Jun 19 15:55:42 2017 +0100)
Hardware: Here is the output of lshw -c video, showing Radeon HD 8870M with the open-source radeon driver:
Code:

  *-display                 
       description: VGA compatible controller
       product: Venus XT [Radeon HD 8870M / R9 M270X/M370X]
       vendor: Advanced Micro Devices, Inc. [AMD/ATI]
       physical id: 0
       bus info: pci@0000:01:00.0
       version: 00
       width: 64 bits
       clock: 33MHz
       capabilities: pm pciexpress msi vga_controller bus_master cap_list rom
       configuration: driver=radeon latency=0
       resources: irq:28 memory:e0000000-efffffff memory:f7e00000-f7e3ffff ioport:e000(size=256) memory:c0000-dffff


The same code, unmodified, does work fine on my desktop with an Nvidia GTX 570 using the proprietary nv drivers. I can't confirm until I get back home tonight, but it looks like my desktop supports compatibility profile for version 330 shaders, while this laptop does not, as glxinfo on the laptop shows compatibility profile supports a max shader version of 130 and GL version 3.0. I mention this because it appears when using Linux/GraphicsWindowX11, OSG creates a compatibility profile if the programmer requests or intends to create a core profile. Is this intentional? Looking at line 820 in GraphicsWindowX11, I think this line might be creating the maximum compatibility profile, and "glXCreateContextAttribsARB" may be required to create core profile contexts if requested by the developer. Around line 1873 of GraphicsWindowWin32, it appears "glContextVersion" is parsed and the (Windows) ARB method is used.
Back to top
View user's profile Send private message
ne0ndrag0n
Newbie


Joined: 22 Jul 2017
Posts: 3

PostPosted: Sun Jul 23, 2017 5:02 pm    Post subject:
Re: OSG is unable to create 3.3 core profile context
Reply with quote

mp3butcher wrote:
Is example osgsimplegl3 working?


It is not. Similar error as my own application:

Quote:

VERTEX glCompileShader "" FAILED
VERTEX Shader "" infolog:
0:1(10): error: GLSL 1.40 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

FRAGMENT glCompileShader "" FAILED
FRAGMENT Shader "" infolog:
0:1(10): error: GLSL 1.40 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

Back to top
View user's profile Send private message
mp3butcher (Julien Valentin)
Appreciator


Joined: 17 Feb 2010
Posts: 349

PostPosted: Sun Jul 23, 2017 9:03 pm    Post subject:
Re: OSG is unable to create 3.3 core profile context
Reply with quote

Hi

Seams a driver issue (as your hardware is gl4.3 ready)
perhaps your fglrx driver doesnt properly support your hw,
perhaps you have install mesa driver
your glxinfo output seams quite short, is it reporting direct rendering: Yes ?
My advices:
try reinstall your driver
sudo apt-get remove --purge fglrx
sudo apt-get install fglrx
try to run a simplegl3 example
if it doesnt work install latest proprietaty driver from
http://support.amd.com/en-us/kb-articles/Pages/AMDGPU-PRO-Driver-for-Linux-Release-Notes.aspx
Hope it helps

ne0ndrag0n wrote:
mp3butcher wrote:
Is example osgsimplegl3 working?


It is not. Similar error as my own application:

Quote:

VERTEX glCompileShader "" FAILED
VERTEX Shader "" infolog:
0:1(10): error: GLSL 1.40 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

FRAGMENT glCompileShader "" FAILED
FRAGMENT Shader "" infolog:
0:1(10): error: GLSL 1.40 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

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts Terrain Deformation as per Road Profile umesh VirtualPlanetBuilder [vpb] 0 Mon Dec 04, 2017 4:44 pm View latest post
No new posts Unable to load texture in the same fo... EonStrife Plugins [osgPlugins] 1 Mon Nov 27, 2017 2:37 am View latest post
No new posts Unable to load texture in relative path EonStrife Plugins [osgPlugins] 0 Mon Nov 27, 2017 2:35 am View latest post
No new posts Access to gl context psquare General 2 Fri Nov 10, 2017 1:32 pm View latest post
No new posts Draw thread per opengl context instea... BenM General 6 Thu Nov 09, 2017 2:23 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP