I'm guessing OpenGL is probably not the bottleneck here. Each 
GLLinePlotItem is a Python object and each GLViewWidget.paintGL update 
iterates over them. If there's any way to combine your lines into a mesh or 
a single GLLinePlotItem, you'd probably see reasonable performance. As a 
test, you could try plotting an equivalent number of points in a single 
GLLinePlotItem and see if that brings the FPS up.

I think the opengl module handles NaNs well. You might be able to "cut" a 
single line into pieces by concatenating lines and inserting np.nan between 
them.

On Friday, March 27, 2020 at 12:34:43 AM UTC-7, Nick PV wrote:
>
>
> I have a problem when openGLWidget *(on PyQt5 Qdialog form) *significantly 
> slowing down for pan or rotate when it displaying more then 2-3 thousand 
> lines (or thousand polygons) plotted in 3D space.
>
> Is there any technique to make it work smoothly (change refresh rate or 
> anything what is applicable) or it's just how openGLWidget performs, that 
> it is not capable to hold a big amount of independent lines?
>
> For note, I have very powerful PC with powerful discrete graphic card, so 
> computer performance is not a case.
>
> Just for example (cut from a context code) I'm plotting lines in this way:
>
>
> import pyqtgraph.opengl as gl 
> from pyqtgraph.Qt import QtWidgets 
> import numpy as np
>
> self.app = QtWidgets.QApplication(sys.argv) 
> self.w = gl.GLViewWidget() 
>
>
> pl_line = ([(1, 1, 1), (2, 2, 2)])  # [Start coordinates(X,Y,Z), End 
> coordinates (X,Y,Z)]
>
> pl_line = np.array(pl_line)
> newline = gl.GLLinePlotItem(pos=pl_line, color=red, width=1, antialias=False) 
> # Regular line plotting
>
>
> self.w.addItem(newline) 
> self.w.show() 
> self.app.exec()
>
> So, when I have even 500 lines on the 3D plot it's still smooth, but once I 
> going beyond that up to 2 thousand of lines it's FPS drops to 3-5 FPS when 
> I'm rotating the plot scene. 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyqtgraph/da493888-f276-4604-bee4-1761a660b680%40googlegroups.com.

Reply via email to