Open pbartfai opened 4 months ago
Changing the memory usage to high or medium will cause total mess. With low memory usage, the display is better, but not perfect. Problem experienced with QOpenGLWidget on both Wayland and xcb.
When rotating the model the earlier phases are not cleared, background is not refreshed:
Problem could be recreated with Qt6 example openglwindow (https://doc.qt.io/qt-6/qtopengl-openglwindow-example.html) Similar issues on the following Qt5 examples:
The ghosting problem sounds like a problem with double buffering, but it could also be a problem with clearing the color buffers in the back buffer.
The memory usage problems are probably related to display lists, since changing the memory usage setting mainly changes what gets stored in display lists. (The high memory usage setting also flattens the conditional line geometry to the top level to allow for multithreaded conditional processing.)
Given that you see the same problems in the Qt examples, I would say that either Qt itself is broken, or that Wayland is broken. If I had to guess, they never bothered to test OpenGL 1.x functionality.
Unfortunately, I can't think of anything to do to fix LDView. You may be able to fiddle around with the QOpenGLWidget
's buffering settings to fix the ghosting, and you may not (since it certainly appears to be Qt and/or Wayland that is broken, not LDView).
For the memory usage problems, I feel that the same applies, but you could test my supposition about display lists by modifying the code to never set the display list flags to true when running in Qt6. I think that the best way to do this is to just use #ifdef
s in TREMainModel.h to override setCompilePartsFlag
and setCompileAllFlag
to not do anything. (The flags default to false, so preventing them from being set to true would disable display list usage.) If this works, go ahead and rearrange the code so that those two functions are next to each other so you only need one #ifdef
/#else
pair.
If you can't figure out how to fix the ghosting by tweaking the QOpenGLWidget
's settings, try calling setSlowClear(true)
on the LDrawModelViewer
instance.
Regarding snapshot saves, I don't even know where to begin. Once again, I strongly suspect that the problem is buggy Qt and/or Wayland, and I don't have any real hope of figuring out a fix.
Describe the bug Backing store is not working on Qt6 using QOpenGLWidget
To Reproduce to build run the following command: qmake-qt6.sh -spec linux-g++-64 ; make clean all
run the following command ./LDView -platform wayland ../m6459.ldr
Expected behavior Clear background is expected
Screenshots
Platform (please complete the following information):
Additional context Same issue ont Qt5 if option QOPENGLWIDGET is enabled. Without option QOPENGLWIDGET blank window is displayed on Wayland.