QCustomPlot Discussion and Comments

Plotting slower after setOpenGl(true)Return to overview

After switching to OpenGL the performance of plot updates became noticeably slower.

I used setOpenGl(true) and checked right after if switching to OpenGL was successful (i.e. openGl() returned true). I I used an OpenGL benchmark software to make sure there wasn't anything wrong with my machine. Everything looked fine.

QCustomPlot without setOpenGl works exceptionally well until I try to use line thicknesses above 1. I'm using Qt 5.7.

I've been continuing to try to debug what is going wrong here. Taking my existing project out of the equation, I switched over to the interactions example. It works flawlessly and responds very quickly as is. Just by adding a callsetOpenGl(true); slows down the responsiveness considerably.

Hi, could you give some information on your system? Like Operating System, Qt version, System Hardware.

It seems like Qt's OpenGL Painter backend is doing strange things in your case. Do you by any chance know how to Qt's own OpenGL examples, or other OpenGL based applications perform?

Thanks for replying.

I just ran a few of Qt's OpenGL examples (OpenGL Accelerated Series, OpenGL Window Example, Cube Open GL ES 2.0 Example, 2D Painting Example, and Hello GL2 Example). The all ran perfectly. The OpenGL accelerated series for example ran at 55-60 FPS with OpenGL and 33 FPS without it.

I'm using Windows 7 64-bit with Qt 5.7.0 MSCV2015_64bit.
Intel Core i7-4712HQ @ 2.30 GHz
NVIDIA Quadro K1100M

I did try the QCP Interactions example on another machine with QCP 2.0 both with and without OpenGL and the performance was comparable.

I observe the same issue. When i'm enabling opengl option, my plot is slowing down. I have the same system and library version as Kris. I try to disable Vsync but without result. Any ideas?

Same with me. Windows 7 x64, with Qt 5.7 MSVC2013 x64.
i7 2600k @ 4.8GHz, 8GB RAM, HD6850.

CPU renderer uses about 7% CPU in a given application (redrawing a particular plot every 17ms), OpenGL uses 15%. I remember having a go when QCP2 Beta was new and it worked a dream with Qt 5.6. I think it might be something to do with the OpenGL changes in 5.7.

Keep in mind that in order to get QCustomPlot2 working in OpenGL mode on Qt 5.7, I edited the source code as per Robert's post here:
http://www.qcustomplot.com/index.php/support/forum/1145<br />

Perhaps getting the new OpenGLFunctions pointer every frame is what slows it down.

Espocjo suggestion has no difference for me. Any other propositions?

Ahh, no luck on 5.6?

QCustomPlot 1 supports OpenGL on Qt 4, I think. Or maybe it's Qt 3?
Either way, you won't be able to access the new Qt 5 functions.

I'm using QT 5.7.0 and QCustomPlot 2.0.0 beta. Platform Win7 64.
I observe the same situation for MinGW and MSVC_2016_64bit.

When i have disabled openGL i reached ~33FPS but when i'm tuning on openGL i have only ~14FPS.

Try these changes for Qt 5:
1. add "#include <QOpenGLFunctions>" in qcostumplot.h.
2. Modify the definition of QCPPaintBufferGlFbo,that is to say,
class QCP_LIB_DECL QCPPaintBufferGlFbo : public QCPAbstractPaintBuffer, protected QOpenGLFunctions
3. add "initializeOpenGLFunctions();" in QCPPaintBufferGlFbo constructor.

Thank you Baohe for suggestion but its not working. Any other ideas?

i use the example in the qcustomplot package which in the dir QCustomPlot2\examples\plots, and i chose the setupRealtimeDataDemo.
with openGL, it only reach 67fps
without openGL, it reach 189fps

intel hd graphics 520


I got the same result with chzw.Maybe my pc is poorer,I got 22 fps when I use opengl into the setupRealtimeDataDemo.I truly want to know can qcustomplot really improve the plot quality of real time data?If someone would tell me?

I'm observing the same results. Has anyone found a solution or observed performance improvement after setOpenGl(true);?

I have the same problem. Software renderer is significantly faster than OpenGL.
Qt 5.10.0 (MSVC 2015, 32 bit)
I had the linker error about undefined glClear and adding LIBS += -lOpenGL32 solved that. Maybe that's the case?

aaleexx: No that wasn't the case. Using the right calls as suggested in the link above fixes the linker problem without adding the -lOpenGL32 line.
Still though, the performance is horrible in OpenGL compared to software renderer.

This is quite weird. It should be the other way around.

I have exactly the same problem: FPS declines to 2 with around 4 millions points on screen, and OpenGl doesn't help here. On the contrary FPS are much higher without OpenGL when only a few hundreds points are available for plotting. Any solution?

did anyone found something? - i have same problem and i would like to do something about it.
any idea what can cause this slowdown? where to dig?