[osg-users] GL3 Profile
Robert Osfield
robert.osfield at gmail.com
Mon Jun 25 01:32:37 PDT 2018
Hi Maxim.
On Sat, 23 Jun 2018 at 18:19, Maxim Stere <osgforum at tevs.eu> wrote:
> 1) I've been playing around with GL3 and CORE profiles on windows, and noticed that for CORE, the CMake script makes VS look for GL/glcorearb.h and for GL3 profile it makes VS look for GL3/gl3.h neither of which are present on windows or VS. Just taking the glcorearb.h from the cronos page and placing it in the GL folder leads to other missing libraries.
> Is this a bug? If I change the CMake script to just look for the standard gl/GL.h on windows, everything compiles and builds.
> If that is how it should be, I can submit a fix for this, so that if set, GL3 profile would not create errors in the build, using only gl/GL.h and still turning off all the deprecated functions. Getting CORE to work is a bit more work....but at least GL3 will work...
This isn't a bug, just an awkward/inconstent way that GL3 is exposed
across platforms, so we've had to have GL3 and GLCORE variants to
attempt to cope with this. Within Cmake you can adjust the settings
yourself, the OPENGL_PROFILE are there to just provide defaults - best
guesses as to what you might need.
> 2) When I do have GL3 profile enabled on windows, CMake turns off the fixed function pipeline and a few other deprecated functionalities. After I build OSG with this, most of the examples stop running correctly. I see a lot of GL errors and warning about things missing.
> Is this a normal thing? Are they just not converted to using newer GL functionality?
This is normal. OpenGL core profile deliberatly drops all backwards
compatibility. OpenGL provides now mapping from fixed function
pipeline to shaders for us so to do this requires the whole fixed
function pipeline state to have a mapping matained by the OSG, this is
huge task so not something we can easily add.
Unless you need to run on MacOS with it's restrictions on exposing
modern GL features to just GLcore profile I would not recommend
building against GLcore profile, the whole deprecation strategy for
OpenGL has ended up a bit of mess and has caused more problems that it
solved. Outside of MacOS all the other desktop platforms still fully
support GL2 and with the advanced features all accessible via
extentions - the OSG will automatically set these all up for you. So
you can best of both worlds, continence of having fixed function still
work plus all the new features working as well.
Robert.
More information about the osg-users
mailing list