TUDelft-CNS-ATM / bluesky

The open source air traffic simulator
GNU General Public License v3.0
342 stars 239 forks source link

Qt GUI scale issue #491

Open rgovindjee opened 7 months ago

rgovindjee commented 7 months ago

In both WSL (Ubuntu 22.04) and Windows 10 natively I'm seeing a graphics bug when running with Qt graphics where all waypoints appear as giant triangles (see image). Aircraft also appear at a drastically incorrect scale, and this does not change with zoom level. This does not appear in when using pygame, but we're having issues with FF mode in pygame (possibly unrelated?), and would therefore like to use Qt.

qt_bug

jooste commented 7 months ago

This has been reported once before, and seems to be related to an incompatibility between a shader setting and your video card driver. I can't reproduce this, so it's difficult to fix. I'll have a look again though, who knows :)

jooste commented 7 months ago

Hi @rgovindjee, the only difference with other (working) GL functions that I can see is the use of QOpenGLShaderProgram.setAttributeValue to set a fixed scale for screen-coordinates shapes. I've just committed a potential fix which directly uses glVertexAttrib1f instead. Could you try and see if this fixes your issue?

rgovindjee commented 7 months ago

Thanks for looking into this. Unfortunately this doesn't seem to have resolved the problem.

We seem to have fixed our error with pygame, so can just use that instead. My understanding is there should be no functionality difference?

jooste commented 7 months ago

Yes, although it is not actively maintained, so it could be that incompatibilities exist.

Could you let me know a bit more about the system you are having these issues on? You were saying both windows and linux, so drivers shouldn't be the problem. What video card do you have? It would be useful if we could reproduce this problem ourselves.

jooste commented 7 months ago

Hi @rgovindjee, can you check if the size of the symbols scales with the zoom factor? Does the symbol size change when you zoom in/out?

rgovindjee commented 7 months ago

The symbols increase in size (more pixels) when zooming in, aka stay the same "size" relative to the map terrain texture.

I can get system/hardware info in a bit.

jooste commented 7 months ago

Ok, in that case it looks like the switch statement in the shader is not honoured. Let's see if we can come up with an alternative approach.

TejEddineLakhal commented 3 months ago

I came across this graphics bug on Windows 10. In my case setting python.exe to use "high-performance NVIDIA processor" instead of "integrated graphics" as preferred graphics processor in the NVIDIA control panel fixes the issue. My system configuration is:

jooste commented 2 months ago

Hey @TejEddineLakhal, thanks a lot, that's a useful suggestion!