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 

GL profiles issues on Windows


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
Riccardo Corsi
Guest





PostPosted: Tue Sep 04, 2018 8:46 pm    Post subject:
GL profiles issues on Windows
Reply with quote

Hi all,


I have some osg-based libraries that are addressing only GL3+ Core profile functionalities, as I need them to work on Mac. 


Now on Windows, I expected them to work just by compiling osg with the OSG_GL3_AVAILABLE flag.
What happens instead is:
- if I build osg with GL core profile (no GL 1 and 2, no FFP enabled, ecc...) everything works

- if I build osg just adding the OSG_GL3_AVAILABLE flag and launch the application by specifying a GL 3.2 Compatibility profile, I get no errors but nothing shows up


Are my expectations correct? Should I check some more compilation / runtime settings to have it working?


My setup is:
osg 3.6.2
win 10
nvidia GTX card


Thank you,
Riccardo

------------------
Post generated by Mail2Forum
Back to top
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12322

PostPosted: Wed Sep 05, 2018 7:28 am    Post subject:
GL profiles issues on Windows
Reply with quote

Hi Riccardo,

The OSG_GL*_AVAILABLE flags are the lower level switches, if you want
a core profile with none of the fixed funcion pipeline then the
OSG_GL1 + GL2_AVAILABLE will need to be OFF. There are other controls
as well.

The best way to get everything set correct is to run CMake with
OSG_GL_PROFILE set to GLCORE, this high level mechanisn will set all
the low level stuff you need.

Cheers,
Robert.
On Tue, 4 Sep 2018 at 21:44, Riccardo Corsi <> wrote:
Quote:

Hi all,

I have some osg-based libraries that are addressing only GL3+ Core profile functionalities, as I need them to work on Mac.

Now on Windows, I expected them to work just by compiling osg with the OSG_GL3_AVAILABLE flag.
What happens instead is:
- if I build osg with GL core profile (no GL 1 and 2, no FFP enabled, ecc...) everything works
- if I build osg just adding the OSG_GL3_AVAILABLE flag and launch the application by specifying a GL 3.2 Compatibility profile, I get no errors but nothing shows up

Are my expectations correct? Should I check some more compilation / runtime settings to have it working?

My setup is:
osg 3.6.2
win 10
nvidia GTX card

Thank you,
Riccardo



------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Riccardo Corsi
Guest





PostPosted: Wed Sep 05, 2018 9:24 am    Post subject:
GL profiles issues on Windows
Reply with quote

Hi Robert,


thanks for your reply but I probably didn't explain clearly my issue.


Say I have:
- libA (using only GL Core features, because I want to use this lib also on Mac)
- libB (using also GL 2.x features, target Win only)


If I compile and use only libA against osg built with GLCORE profile, everything works both on Win and Mac.


Now what I'd like to do (on Win only) is to use libA and libB together.

To do so I expected it was enough to add the OSG_GL3_AVAILABLE flag to build OSG and to request a Compatibility GL context. 
What happens instead is that I don't see anything of what libA is supposed to render, even though I don't get any GL error on the console.

Riccardo




On Wed, Sep 5, 2018 at 9:27 AM Robert Osfield < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
Hi Riccardo,

The OSG_GL*_AVAILABLE flags are the lower level switches, if you want
a core profile with none of the fixed funcion pipeline then the
OSG_GL1 + GL2_AVAILABLE will need to be OFF.  There are other controls
as well.

The best way to get everything set correct is to run CMake with
OSG_GL_PROFILE set to GLCORE, this high level mechanisn will set all
the low level stuff you need.

Cheers,
Robert.
On Tue, 4 Sep 2018 at 21:44, Riccardo Corsi < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:

Hi all,

I have some osg-based libraries that are addressing only GL3+ Core profile functionalities, as I need them to work on Mac.

Now on Windows, I expected them to work just by compiling osg with the OSG_GL3_AVAILABLE flag.
What happens instead is:
- if I build osg with GL core profile (no GL 1 and 2, no FFP enabled, ecc...) everything works
- if I build osg just adding the OSG_GL3_AVAILABLE flag and launch the application by specifying a GL 3.2 Compatibility profile, I get no errors but nothing shows up

Are my expectations correct? Should I check some more compilation / runtime settings to have it working?

My setup is:
osg 3.6.2
win 10
nvidia GTX card

Thank you,
Riccardo
_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


------------------
Post generated by Mail2Forum
Back to top
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12322

PostPosted: Wed Sep 05, 2018 9:37 am    Post subject:
GL profiles issues on Windows
Reply with quote

Hi Riccardo,

On Wed, 5 Sep 2018 at 10:23, Riccardo Corsi <> wrote:
Quote:
Now what I'd like to do (on Win only) is to use libA and libB together.
To do so I expected it was enough to add the OSG_GL3_AVAILABLE flag to build OSG and to request a Compatibility GL context.
What happens instead is that I don't see anything of what libA is supposed to render, even though I don't get any GL error on the console.

I you are just building the OSG with defaults, so will provide a
compatibility profile. then the OSG at runtime will check for all the
GL3/GL4 features and allow you to use this, you don't need to
explicitly enable them via OSG_GL3_AVAILABLE.

For compatibility with OSX then you'll need to use the CMake option of
OPENGL_PROFILE=GLCORE.

If you create an application that works with GLCORE then this same
application will build and run just fine on the OSG built with
defaults.

Robert.


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


Joined: 06 Feb 2013
Posts: 105

PostPosted: Wed Sep 05, 2018 10:18 am    Post subject:
GL profiles issues on Windows
Reply with quote

Hi Robert,

I thin k Riccardo wants to use both libs (libA glcore, linB non glcore)
in the same app on Windows.
In my understanding this is not possible at all.

- Werner -

Am 05.09.2018 um 11:36 schrieb Robert Osfield:
Quote:
Hi Riccardo,

On Wed, 5 Sep 2018 at 10:23, Riccardo Corsi <> wrote:
Quote:
Now what I'd like to do (on Win only) is to use libA and libB together.
To do so I expected it was enough to add the OSG_GL3_AVAILABLE flag to build OSG and to request a Compatibility GL context.
What happens instead is that I don't see anything of what libA is supposed to render, even though I don't get any GL error on the console.
I you are just building the OSG with defaults, so will provide a
compatibility profile. then the OSG at runtime will check for all the
GL3/GL4 features and allow you to use this, you don't need to
explicitly enable them via OSG_GL3_AVAILABLE.

For compatibility with OSX then you'll need to use the CMake option of
OPENGL_PROFILE=GLCORE.

If you create an application that works with GLCORE then this same
application will build and run just fine on the OSG built with
defaults.

Robert.





------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Riccardo Corsi
Guest





PostPosted: Wed Sep 05, 2018 2:57 pm    Post subject:
GL profiles issues on Windows
Reply with quote

Hi all,


I've rebuilt osg as suggested by Robert and still getting no GL errors but nothing shows up.
To sum it up, running a test app which only uses libA (which addresses only GL3 functions and shaders version 150)
under windows:
- if I link my code to OSG built with  GLCORE profile everything works
- if I link the same code to OSG build with defaults, nothing shows up


As further check, I tried the same with osgsimplegl3 example which works in both OSG builds. 
Any idea on what could be the culprit of my code not working in the same way?


@Werner you're correct, I'd like to use both libs in the same app on Windows,
I think this should be possible with Compatibility profile.



Thank you




On Wed, Sep 5, 2018 at 12:17 PM Werner Modenbach < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
Hi Robert,

I thin k Riccardo wants to use both libs (libA glcore, linB non glcore)
in the same app on Windows.
In my understanding this is not possible at all.

- Werner -

Am 05.09.2018 um 11:36 schrieb Robert Osfield:
Quote:
Hi Riccardo,

On Wed, 5 Sep 2018 at 10:23, Riccardo Corsi < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Now what I'd like to do (on Win only) is to use libA and libB together.
To do so I expected it was enough to add the OSG_GL3_AVAILABLE flag to build OSG and to request a Compatibility GL context.
What happens instead is that I don't see anything of what libA is supposed to render, even though I don't get any GL error on the console.
I you are just building the OSG with defaults, so will provide a
compatibility profile. then the OSG at runtime will check for all the
GL3/GL4 features and allow you to use this, you don't need to
explicitly enable them via OSG_GL3_AVAILABLE.

For compatibility with OSX then you'll need to use the CMake option of
OPENGL_PROFILE=GLCORE.

If you create an application that works with GLCORE then this same
application will build and run just fine on the OSG built with
defaults.

Robert.
_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


------------------
Post generated by Mail2Forum
Back to top
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12322

PostPosted: Wed Sep 05, 2018 3:25 pm    Post subject:
GL profiles issues on Windows
Reply with quote

Hi Riccardo,

On Wed, 5 Sep 2018 at 15:56, Riccardo Corsi <> wrote:
Quote:
I've rebuilt osg as suggested by Robert and still getting no GL errors but nothing shows up.
To sum it up, running a test app which only uses libA (which addresses only GL3 functions and shaders version 150)
under windows:
- if I link my code to OSG built with GLCORE profile everything works
- if I link the same code to OSG build with defaults, nothing shows up

As further check, I tried the same with osgsimplegl3 example which works in both OSG builds.
Any idea on what could be the culprit of my code not working in the same way?

My best guess is that the GLCORE build of the OSG is setting up the
osg::State vertex and uniform aliasing that you shaders are relying
upon, but in the default build of the OSG these are set by default so
you have to manually set them.

The osgsimplegl3 example illustrates and explains this:

// for non GL3/GL4 and non GLES2 platforms we need enable the osg_
uniforms that the shaders will use,
// you don't need thse two lines on GL3/GL4 and GLES2 specific
builds as these will be enable by default.
gc->getState()->setUseModelViewAndProjectionUniforms(true);
gc->getState()->setUseVertexAttributeAliasing(true);

These two settings are done by default for GLCORE build, but are off
by default so have to be set explicitly for non GLCORE builds.

The osgvertexattributes and osgtessellationshaders examples have a
more general purpose approach:

osgViewer::Viewer::Windows windows;
viewer.getWindows(windows);
for(osgViewer::Viewer::Windows::iterator itr = windows.begin();
itr != windows.end();
++itr)
{
osg::State *s=(*itr)->getState();
s->setUseModelViewAndProjectionUniforms(true);
s->setUseVertexAttributeAliasing(true);
}

Probably the most general way to wrap this up would be to have a
custom RealizeOperation do this, the osgvolume example has an example
of this, although not for the State::setUse*Aliasing(true);

Hope this helps,
Robert.


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Riccardo Corsi
Guest





PostPosted: Thu Sep 06, 2018 9:50 am    Post subject:
GL profiles issues on Windows
Reply with quote

Hi Robert, 


good guess! I've enabled the aliasing and my shaders works now with osg default build!
With this configuration there is still a side effect though: something is wrong with alpha settings for HUD cameras.
See attached screenshot that shows the issue: it's a modified osgsimplegl3 example with stats handler enabled, but I have alpha issues with other HUDs as well.
I've counter checked in my examples that the 2 aliasing/uniform calls are the culprit: if I comment them out the shaders don't work anymore but the stats are displayed correctly. 


Riccardo



On Wed, Sep 5, 2018 at 5:24 PM Robert Osfield < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
Hi Riccardo,

On Wed, 5 Sep 2018 at 15:56, Riccardo Corsi < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
I've rebuilt osg as suggested by Robert and still getting no GL errors but nothing shows up.
To sum it up, running a test app which only uses libA (which addresses only GL3 functions and shaders version 150)
under windows:
- if I link my code to OSG built with  GLCORE profile everything works
- if I link the same code to OSG build with defaults, nothing shows up

As further check, I tried the same with osgsimplegl3 example which works in both OSG builds.
Any idea on what could be the culprit of my code not working in the same way?

My best guess is that the GLCORE build of the OSG is setting up the
osg::State vertex and uniform aliasing that you shaders are relying
upon, but in the default build of the OSG these are set by default so
you have to manually set them.

The osgsimplegl3 example illustrates and explains this:

    // for non GL3/GL4 and non GLES2 platforms we need enable the osg_
uniforms that the shaders will use,
    // you don't need thse two lines on GL3/GL4 and GLES2 specific
builds as these will be enable by default.
    gc->getState()->setUseModelViewAndProjectionUniforms(true);
    gc->getState()->setUseVertexAttributeAliasing(true);

These two settings are done by default for GLCORE build, but are off
by default so have to be set explicitly for non GLCORE builds.

The osgvertexattributes and osgtessellationshaders examples have a
more general purpose approach:

    osgViewer::Viewer::Windows windows;
    viewer.getWindows(windows);
    for(osgViewer::Viewer::Windows::iterator itr = windows.begin();
        itr != windows.end();
        ++itr)
    {
        osg::State *s=(*itr)->getState();
        s->setUseModelViewAndProjectionUniforms(true);
        s->setUseVertexAttributeAliasing(true);
    }

Probably the most general way to wrap this up would be to have a
custom RealizeOperation do this, the osgvolume example has an example
of this, although not for the State::setUse*Aliasing(true);

Hope this helps,
Robert.
_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


------------------
Post generated by Mail2Forum
Back to top
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12322

PostPosted: Thu Sep 06, 2018 10:44 am    Post subject:
GL profiles issues on Windows
Reply with quote

Hi Ricardo,

On Thu, 6 Sep 2018 at 10:49, Riccardo Corsi <> wrote:
Quote:
good guess! I've enabled the aliasing and my shaders works now with osg default build!
With this configuration there is still a side effect though: something is wrong with alpha settings for HUD cameras.
See attached screenshot that shows the issue: it's a modified osgsimplegl3 example with stats handler enabled, but I have alpha issues with other HUDs as well.
I've counter checked in my examples that the 2 aliasing/uniform calls are the culprit: if I comment them out the shaders don't work anymore but the stats are displayed correctly.

I'm busy with other work right now so can't look at the modified code
right away.

My best guess right now is that osgText and the StatsHandler are using
GL2 shader paths that assume gl_ builtins are available, but with the
aliasing enabled perhaps this is causing problem. Could you set the
DIsplaySettings ShaderHint to GL3 to see if that helps i.e.

To the main before the scene graph setup add:

osg::DisplaySettings::instance()->setShaderHint(osg::DisplaySettings::SHADER_GL3);

Robert.


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Riccardo Corsi
Guest





PostPosted: Thu Sep 06, 2018 3:44 pm    Post subject:
GL profiles issues on Windows
Reply with quote

Hi Robert,


I tried adding the setShaderHint() line but things get a bit worse - alpha issue still there and not text at all, see attached screenshot.


I get display errors also in my other HUD contents where I actually use gl_ builtins so your guess might be right,
but unfortunately adding the ShaderHint does not fix it.


Riccardo


On Thu, Sep 6, 2018 at 12:42 PM Robert Osfield < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
Hi Ricardo,

On Thu, 6 Sep 2018 at 10:49, Riccardo Corsi < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
good guess! I've enabled the aliasing and my shaders works now with osg default build!
With this configuration there is still a side effect though: something is wrong with alpha settings for HUD cameras.
See attached screenshot that shows the issue: it's a modified osgsimplegl3 example with stats handler enabled, but I have alpha issues with other HUDs as well.
I've counter checked in my examples that the 2 aliasing/uniform calls are the culprit: if I comment them out the shaders don't work anymore but the stats are displayed correctly.

I'm busy with other work right now so can't look at the modified code
right away.

My best guess right now is that osgText and the StatsHandler are using
GL2 shader paths that assume gl_ builtins are available, but with the
aliasing enabled perhaps this is causing problem.  Could you set the
DIsplaySettings ShaderHint to GL3 to see if that helps i.e.

To the main before the scene graph setup add:

   osg::DisplaySettings::instance()->setShaderHint(osg::DisplaySettings::SHADER_GL3);

Robert.
_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


------------------
Post generated by Mail2Forum
Back to top
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12322

PostPosted: Thu Sep 06, 2018 4:07 pm    Post subject:
GL profiles issues on Windows
Reply with quote

Hi Riccardo,

On Thu, 6 Sep 2018 at 16:43, Riccardo Corsi <> wrote:
Quote:
I tried adding the setShaderHint() line but things get a bit worse - alpha issue still there and not text at all, see attached screenshot.

I get display errors also in my other HUD contents where I actually use gl_ builtins so your guess might be right,
but unfortunately adding the ShaderHint does not fix it.

Do you know if this combination of OSG usage fails on other platforms?

Robert.


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Riccardo Corsi
Guest





PostPosted: Thu Sep 06, 2018 7:57 pm    Post subject:
GL profiles issues on Windows
Reply with quote

Sorry Robert,


at the moment I can only test on Win and Mac, but the second is not a candidate as it requires GL Core profile.


On Thu, Sep 6, 2018 at 6:05 PM Robert Osfield < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:

Quote:
Hi Riccardo,

On Thu, 6 Sep 2018 at 16:43, Riccardo Corsi < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
I tried adding the setShaderHint() line but things get a bit worse - alpha issue still there and not text at all, see attached screenshot.

I get display errors also in my other HUD contents where I actually use gl_ builtins so your guess might be right,
but unfortunately adding the ShaderHint does not fix it.

Do you know if this combination of OSG usage fails on other platforms?

Robert.
_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


------------------
Post generated by Mail2Forum
Back to top
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 Huge perfomance issues axilmar General 9 Thu May 30, 2019 10:53 am View latest post
No new posts Building with MinGW on Windows 10 Skaldi Build system [build] 4 Sat May 18, 2019 3:47 pm View latest post
No new posts CPU Performance issues with AMD 2700 ... robertosfield General 10 Mon Apr 01, 2019 2:01 pm View latest post
No new posts Questions concerning Performance issu... Andrea74 General 3 Fri Dec 14, 2018 11:24 am View latest post
No new posts osgUtil::LineSegmentIntersector perfo... Andrea74 General 6 Tue Dec 04, 2018 4:09 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