-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attempt to use OpenGL compatibility profile by default. #140
Conversation
PyCAM's rendering code relies on the OpenGL fixed function pipeline, which was removed from the OpenGL 3.2 Core profile. Sadly, that is the default version used by Gdk, and the public API of GLArea and GLContext does not allow switching the profile or using a version < 3.2, therefore we have to attempt to change Gdk behaviour through environment variables. Ironically, setting `GDK_GL=legacy' will usually result in a more modern OpenGL version being used, e.g. switching from 3.2 Core to 4.6 Compatibility on my machine.
Maybe it is time to use something other than OpenGL. What is used from
OpenGL and do we have anything that is known to replace those
functionality?
EBo --
…On Mar 30 2019 8:02 PM, Benno Evers wrote:
PyCAM's rendering code relies on the OpenGL fixed function
pipeline, which was removed from the OpenGL 3.2 Core profile.
Sadly, that is the default version used by Gdk, and the public
API of GLArea and GLContext does not allow switching the profile
or using a version < 3.2, therefore we have to attempt to change
Gdk behaviour through environment variables.
Ironically, setting `GDK_GL=legacy' will usually result in
a more modern OpenGL version being used, e.g. switching from
3.2 Core to 4.6 Compatibility on my machine.
You can view, comment on, or merge this pull request online at:
#140
-- Commit Summary --
* Attempt to use OpenGL compatibility profile by default.
-- File Changes --
M pycam/Plugins/__init__.py (7)
-- Patch Links --
https://github.com/SebKuzminsky/pycam/pull/140.patch
https://github.com/SebKuzminsky/pycam/pull/140.diff
|
Well, for the amount of OpenGL code being used, judge for yourself:
So I'd personally recommend against re-implementing that, since it's probably going to take 100+ hours just to get back to the state that's currently working, but of course you're free to spend your time as you see fit. Until that replacement is finished, though, I think it would be better to have the OpenGL version not be broken by default on most modern systems. |
Another option besides reimplementing is to strip the old version of
the these functions as a modified version of the dependencies, or
possibly installing in /opt/pycam as version pinned dependency install.
…On Mar 31 2019 5:28 AM, Benno Evers wrote:
Well, for the amount of OpenGL code being used, judge for yourself:
```
~/src/pycam/pycam$ find . -name '*OpenGL*' | xargs wc -l
113 ./Plugins/OpenGLViewGrid.py
76 ./Plugins/OpenGLViewDimension.py
73 ./Plugins/OpenGLViewSupportModelPreview.py
192 ./Plugins/OpenGLViewModel.py
94 ./Plugins/OpenGLViewBounds.py
77 ./Plugins/OpenGLViewAxes.py
948 ./Plugins/OpenGLWindow.py
49 ./Plugins/OpenGLViewTool.py
158 ./Plugins/OpenGLViewToolpath.py
84 ./Gui/OpenGLTools.py
1864 total
~/src/pycam/pycam$ grep gl[A-Z] . -r | wc -l
242
```
So I'd personally recommend against re-implementing that, since it's
probably going to take 100+ hours just to get back to the state
that's
currently working, but of course you're free to spend your time as
you
see fit.
Until that replacement is finished, though, I think it would be
better to have the OpenGL version not be broken by default on most
modern systems.
|
Indeed the above is surely an improvement of the current state - so I will just merge it. Thank you! Regarding the replacement: it is almost there (as usual): #135 (comment) (see branch The usability of the new 3D visualization is still a bit painful. I will use my next chunk of pycam-dedicated time for fixing and releasing it. |
Incredibly the last update is working better. The buttons on the visualization canvas now work. |
PyCAM's rendering code relies on the OpenGL fixed function
pipeline, which was removed from the OpenGL 3.2 Core profile.
Sadly, that is the default version used by Gdk, and the public
API of GLArea and GLContext does not allow switching the profile
or using a version < 3.2, therefore we have to attempt to change
Gdk behaviour through environment variables.
Ironically, setting `GDK_GL=legacy' will usually result in
a more modern OpenGL version being used, e.g. switching from
3.2 Core to 4.6 Compatibility on my machine.