PColorMeshItem: implement opengl rendering#3090
Merged
j9ac9k merged 2 commits intopyqtgraph:masterfrom Jul 11, 2024
Merged
Conversation
j9ac9k
reviewed
Jul 8, 2024
j9ac9k
reviewed
Jul 8, 2024
768450a to
0708ee4
Compare
Member
implement use of IBO and flat shading
Member
|
Thanks for this @pijyoi this looks good to me! Merging! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

PColorMeshItemis unusable when a non-small mesh is used.Even panning a static
PColorMeshItemis very slow. (i.e. just redrawing the renderedQPictureis slow)Following the example of the recent OpenGL code updates to
PlotCurveItem, we can makePColorMeshItemusable by rendering using OpenGL.An example to demonstrate the speed.
We can use the peegee icons of various sizes to test out the performance.
On my laptop,
peegee_256px.pngwithout OpenGL gets a dismal 5 fps; whereas with OpenGL,peegee_512@2x.pnghits 30 fps. i.e. an improvement of (1024/256)**2 * 30/5 == 96xAn addition to the
PColorMeshItemAPI. A use-case that I have is that the mesh (XY) is fixed and only the Z values are varying. I have overloaded thesetData(None, None, Z)to mean that the existing X, Y should be re-used. This allows to not waste time uploading vertices that have not changed.(The converse also works:
setData(X, Y, None)means that Z should be re-used; although I don't have such a use-case)One wart is that on termination, the following error message is shown:
This message doesn't show up on a pure
QOpenGLWidgetimplementation. (as opposed to this PR's doing OpenGL painting within aQGraphicsView)