-
Notifications
You must be signed in to change notification settings - Fork 45
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
OpenGL context 3.3+ not found unless requesting 3.3 version #659
Comments
Instead of the above patch, can you take a look see if any of the steps for troubleshooting rendering issues works for you? https://gazebosim.org/docs/latest/troubleshooting/#unable-to-create-the-rendering-window |
Instead of the above patch, can you take a look see if any of the
steps for troubleshooting rendering issues works for you?
https://gazebosim.org/docs/latest/troubleshooting/#unable-to-create-the-rendering-window
Sure, but none of them fix the issue. In particular:
* `update your computer’s OpenGL version`: Mesa is already the latest
version, as well as the intel Xorg driver etc.
* `export LIBGL_DRI3_DISABLE=1` has no effect.
* `export LIBGL_ALWAYS_SOFTWARE=1` kinda works, of course without
hardware acceleration it's not usable in practice.
* `export MESA_GL_VERSION_OVERRIDE=3.3` fixes the OGRE2 error, but
then the rendering is completely buggy (weird textures, or garbage).
* `use Ogre 1` should also work (not tested), but then this would not
fix the issue :)
Let me know if you need more feedback from my side.
|
we actually had the surface format set to 3.3 before in gazebosim/gz-sim#339, but that plugin was replaced by the minimal_scene in gz-gui, which no longer has the surface format setting. I think we can add that back in around here gz-gui/src/plugins/minimal_scene/MinimalScene.cc Line 1211 in db69c56
Just curious, could you see if |
Indeed, patching like so also works:
```
--- src/plugins/minimal_scene/MinimalScene.cc~ 2024-09-27 01:38:17.000000000 +0200
+++ src/plugins/minimal_scene/MinimalScene.cc 2025-03-13 10:21:14.079635782 +0100
@@ -1207,8 +1207,12 @@
// and makeCurrent down below while setting up our own context.
current->doneCurrent();
+ auto surfaceFormat = QSurfaceFormat();
+ surfaceFormat.setMajorVersion(3);
+ surfaceFormat.setMinorVersion(3);
+
this->dataPtr->renderThread->SetContext(new QOpenGLContext());
- this->dataPtr->renderThread->Context()->setFormat(current->format());
+ this->dataPtr->renderThread->Context()->setFormat(surfaceFormat);
this->dataPtr->renderThread->Context()->setShareContext(current);
this->dataPtr->renderThread->Context()->create();
```
Just curious, could you see if MESA_GL_VERSION_OVERRIDE=3.3FC (with
the FC) makes any difference?
Interestingly, with 3.3FC it also works fine.
|
Hi,
Using gz-gui 9.0.0 / gz-rendering 9.0.0 / ogre2.3.3 all built from source on NetBSD 10.1, amd64/intel with graphics hardware as reported by this glxinfo excerpt:
ogre2 fails to initialize its context with the message:
OGRE EXCEPTION(3:RenderingAPIException): OpenGL 3.3 is not supported. Please update your graphics card drivers.
and ogre2.log shows
(it then segfaults later, by the way, but that's a different issue)
If I apply this small patch right after the QApplication constructor then it works perfectly fine:
And in
.gz/rendering/ogre2.log
there is the expected messageI'm not sure wether this fix is correct in terms of genericity, e.g. if it should rather belong to gz-rendering/ogre2, or at least be protected by an 'OGRE2' ifdef or something. I tried various different tricks, patching in different places near or around ogre2 initialization but the above solution was the only one that actually worked.
Let me know if that makes sense to you,
Cheers
Anthony
The text was updated successfully, but these errors were encountered: