Skip to content

PlotCurveItem: setup modelview and projection#1897

Merged
j9ac9k merged 1 commit intopyqtgraph:masterfrom
pijyoi:fix_win32_plotcurveitem_opengl
Jul 16, 2021
Merged

PlotCurveItem: setup modelview and projection#1897
j9ac9k merged 1 commit intopyqtgraph:masterfrom
pijyoi:fix_win32_plotcurveitem_opengl

Conversation

@pijyoi
Copy link
Copy Markdown
Contributor

@pijyoi pijyoi commented Jul 15, 2021

This fixes an "experimental" feature that stopped working on Windows platform since the addition of support for Qt6 (and drop of support for Qt4).
i.e. change from QGLWidget to QOpenGLWidget

Minimal testable example at #1525 (comment)

Would fix #1760

@j9ac9k
Copy link
Copy Markdown
Member

j9ac9k commented Jul 15, 2021

Nice work @pijyoi !

@j9ac9k
Copy link
Copy Markdown
Member

j9ac9k commented Jul 15, 2021

now the question I have is should we consider removing the experimental flag to use openGL with PlotCurveItems?

@pijyoi
Copy link
Copy Markdown
Contributor Author

pijyoi commented Jul 15, 2021

Leave it as experimental. The OpenGL path is not at parity, feature-wise, with the regular path. "connect" is not supported, for example.

It's not clear to me that it even provides a speed benefit.

@j9ac9k
Copy link
Copy Markdown
Member

j9ac9k commented Jul 15, 2021

It's not clear to me that it even provides a speed benefit.

Definitely faster in the case of pen width greater than 1, which is a major performance regression we have seen significant demand to try and address.

@pijyoi
Copy link
Copy Markdown
Contributor Author

pijyoi commented Jul 16, 2021

On a particular Windows machine, using examples\PlotSpeedTest.py modified to disable vsync:

pen width useOpenGL enableExperimental fps
1 False False 260
2 False False 4
1 True False 115
2 True False 110
1 True True 180
2 True True 180

Looks like useOpenGL alone would be good enough for the thick pen widths?

@j9ac9k
Copy link
Copy Markdown
Member

j9ac9k commented Jul 16, 2021

Oh huh, I clearly have something crossed up, I thought enableExperimental had to be set for the openGL to take effect for PlotCurveItem.

Regardless, This PR LGTM, merging. Thank you so much for tracking this down @pijyoi

@j9ac9k j9ac9k merged commit 910142a into pyqtgraph:master Jul 16, 2021
@pijyoi
Copy link
Copy Markdown
Contributor Author

pijyoi commented Jul 16, 2021

I also noticed that the axis fonts were no longer crisp with useOpenGL enabled.

EDIT:
From https://doc.qt.io/qt-5/qopenglpaintdevice.html
"Antialiasing in the OpenGL paint engine is done using multisampling. Most hardware require significantly more memory to do multisampling and the resulting quality is not on par with the quality of the software paint engine. The OpenGL paint engine's strength lies in its performance, not its visual rendering quality."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PyOpenGL rendering broken after upgrade from 0.11.1 to 0.12.1

2 participants