Any OPENGL wizards?
GL_INVALID_OPERATION is generated if glLight is executed between the execution of glBegin and the corresponding execution of glEnd.
forum.openmw.org/viewtopic.php?f=47&t=6153
forum.openmw.org/viewtopic.php?f=8&t=6942
I'm pretty sure you've got something wrong with your OpenGL includes. The most likely culpret is that you've built OSG against GLES instead of regular OpenGL.
You'll need to build OSG 3.6.5 with DesktopGL and not GLES. That is always the biggest problem.
or some reason with compiled from source I get the error that rhioun got when used from repository. With my limited understanding it looks like in my case Qt is compiled against OpenGLES3, so they just switched places. Is this so? And if yes, should I also compile Qt?
Yeah, I hit that with Debian/Ubuntu. They compiled Qt on arm with libGLESv2 isntead of libGL, then they compiled OSG (osgQt) against the libGLESv2 Qt5, so that too must have been libGLESv2. I'll be honest, it doesn't work with OpenMW. OpenMW expects libGL.
there is a bug report that talks about the issue
bugs.debian.org/cgi-bin/bugreport.cgi?bug=838792
osg is some kind of qt application for their game openMW as far as i can tell.
Please Log in or Create an account to join the conversation.
I wonder if this means changing to qopengl would help?
from my understanding of qglwidget vs qopenglwidget that was supposed to solve the problem between the desktop and embedded gl platforms, but that apparently isnt the case.Lol I just looked at qtvismach to test QopenGLWidget and....Surprise that is what I'm already using.
thats what i have been basing my searches from, which narrows it down to video game cross compatibility, the problem has been the errors i get from qt5_graphics have been to broad with no rpi examples and not as much help. searching that light error with vismach turned up instant resultsMaybe making a simple QopenGLWidget program on the pi4 to prove it works?
which narrows it down to an issue with qt, the other gui use glgenlist in the same way and they all work very wellAs I understand it, all linuxcnc opengl programs use legacy code/techniques.
is that this one? github.com/LinuxCNC/linuxcnc/pull/943 I didnt dive to deep into how it works , but i installed the limuxcmc branch, and axis seems to work fine, no errors and it displays everything alrightThere is some people working on GTK3 updates to GladeVCP, and my guess is they will need to update openGL too - so maybe more example code.
looks cool, ill let you know what happenes on rpi4I think this piece of code will work on any platform, as it is lightweight.
Please Log in or Create an account to join the conversation.
Jim
Please Log in or Create an account to join the conversation.
I need some help understanding a few things and someone to check my work to see if im on the right track
I am following this, it checks off all the boxes, as to my understanding of the problem.
github.com/koendv/qt5-opengl-raspberrypi
my understanding of the problem:
-qtvcp preview wont load despite using the same opengl/glu commands as gtk and axis(minigl?)
-qt5 when it installs on arm uses a different graphics library(gles version) to use the hardware acceleration
-qtvcp preview uses the qGLwidget which is not cross compatible, as it calls on things from the desktop version graphics library which
uses opengl
solution:
-install qt5 with the desktop graphics library
the rpi4 can do software rendering on up to opengl3.3 . software rendering axis and gtk is noticeable slower and less appealing visually, but it only seems to have increased cpu usage by a few percent. so I see no reason software rendering of the qtvcp preview would be to much different
so i started here,
github.com/koendv/qt5-opengl-raspberrypi
Qt5.12 LTS with OpenGL for Raspberry
This package installs Qt5.12 LTS "long term support" with desktop OpenGL on a raspberry pi 4 running Raspbian Buster. The package is suitable for compiling desktop-style, windowed Qt apps under X11. The OpenGL support is in software, using Mesa.
this appears to be the one, 18-24 hour mark on the build, it failed, it couldnt locate a file i couldnt find earlier but for something i dont think i need. in the guide it starts using apt install instead of sudo apt-get install which is probably where i went wrong, not doing it in root maybe. Im not really sure to be honest Ive never really compiled something this large.
Also, after reading the whole guide(which seems to go full circle), do i need to build this from source or did the git already do that??
do i just download the qt5-opengl-dev_5.12.5_armhf.deb and install that then install qt5?
this takes a bit too long for my brand of trial and error, so I will read more, but if anyone can offer some advice that would be appreciated,
Please Log in or Create an account to join the conversation.
I did manage to get vtk working in the qtvcp framework, but on large programs, it takes a lot of cpu making me think maybe its not using the gpu. The errors when using the qt5_graphics module were error 28 - invalid operation, making me think that an opengl implementation on the rpi would be software rendered as the gpu firmware is incompatible. I hope this makes sense, I'm no expert.
Please Log in or Create an account to join the conversation.
Traceback (most recent call last):
File "./qt5_graphics.py", line 670, in initializeGL
self.object = self.makeObject()
File "./qt5_graphics.py", line 944, in makeObject
genList = GL.glGenLists(1)
File "/usr/lib/python2.7/dist-packages/OpenGL/platform/baseplatform.py", line 402, in __call__
return self( *args, **named )
File "/usr/lib/python2.7/dist-packages/OpenGL/error.py", line 232, in glCheckError
baseOperation = baseOperation,
OpenGL.error.GLError: GLError(
err = 1282,
description = 'invalid operation',
baseOperation = glGenLists,
cArguments = (1,),
result = 0L
)
Aborted
Please Log in or Create an account to join the conversation.
glxinfo | grep "version"
you can see what graphics drivers/versions are running. one driver is opengl3.3 and the gpu driver is opengl 2.1, i dont remember which is which
ok, thats what i was thinking also.It looks to me like the author already created the deb package ready for installation.
yes, nice work, but your one screenshot scared me away with the huge cpu usage ,I did manage to get vtk working in the qtvcp framework, but on large programs, it takes a lot of cpu making me think maybe its not using the gpu.
yeah, that what im thinking. whatever the other gui';s use for fo their opengl, works with both rpi graphics drivers, with noticeable performance /visual decline when doing software rendering, but not by very much, only a few %. using software rendering with the mesa driver (the graphics one), gives us opengl 3.3 out of the box. there is no reason it shouldnt work, but i just dont know how to make QT call on anyting else other than libglesv2.so which I dont think it should be doing.the errors when using the qt5_graphics module were error 28 - invalid operation, making me think that an opengl implementation on the rpi would be software rendered as the gpu firmware is incompatible. I hope this makes sense, I'm no expert.
which leads me to qtvismach
cmo used the newer qtopenglwidget lib, which is supposed to be some kind of cross platform thing. so it should work on rpi4.
on initial inspection, it has the same problem as qt5_graphics, where opengl/glu calls cant be implemented. those were the kind of graphical errors from qt you get when you try to run the backplot. to get the errors, you need to isolate vismach as an individual window instead of embedded into axis. on further inspection, there is one extra line in the terminal, regarding an error involving calling on libGLESv2.so. I had come across this error while researching the backplot issue, I think it is a good sign, it refers to calling on one graphics driver but cant because its busy, that was as far as i got before i broke my graphics drivers on my main image, so ive been trying to recover from that. I will be doing my further testing using this image posted here, forum.linuxcnc.org/9-installing-linuxcnc...es-not-work?start=60
I would like to see if using a kernel closer to mainline will be of any help, but i would like to see if it has something to do with the older RT kernels referring to the machine hardware as BCM2385 while the new kernel reports BCM2711, it might make no difference depending on where the software gets its version id from
Please Log in or Create an account to join the conversation.
from the raspberrypi forums
Okay, I got it working. From what I can tell, the versions of qt5 and pyqt5 that are available in the normal raspbian repos are too old to support OpenGL in qt5, so the fix is to build qt5 and pyqt5 from source. Here are the steps I used to do that:
- First, I started with a pristine version of the latest Raspberry Pi OS with desktop. The first time I tried this I used an 8 GB sdcard but that turned out to be too small to hold all the build dependencies so I ended up replacing the card with a 64 GB.
- Then I used the steps outlined here to build qt5 and pyqt5 from source. github.com/tiagordc/rpi-build-qt-pyqt The steps outlined at that link worked flawlessly for me.
- Finally, when installing the python modules needed for my project (pyserial, pyopengl, etc) I just used "pip3 install pyserial" etc.
- I DID NOT use apt-get to install any other qt5, pyqt5 or opengl related dependencies since I don't want to disturb my new nicely built libraries.
Once all of the above was complete, my pyqt5 application opened like a champ with the opengl widget contained within it. I think the build process took me about 6 hours on a RPi 4 w/ 8 GB, although I was walking away for long periods so it might have been less than that.
Please Log in or Create an account to join the conversation.
QtPlasma requires a newer version then that to run.
Please Log in or Create an account to join the conversation.
ImportError: No module named PyQt5
In an interactive session using python2.7, the command 'from Pyqt5 import QtWidgets' causes the error.
This leads me to believe that qtvcp is using python2.7 regardless of the system default.
Any help appreciated.
Jim
Please Log in or Create an account to join the conversation.