[Development] Qt Charts poor dynamic/resolution with OpenGL
sean.harmer at kdab.com
Tue Jul 19 21:26:57 CEST 2016
On 19/07/2016 18:26, jeandet wrote:
> Hi All,
> We are developing in my lab a scientific data plot/analysis software
> using Qt Charts module. In order to plot quite large data-sets
> (XYSeries) we enabled OpenGL which produce unexpected behavior. The
> plots values are grouped by X values see here:
> -Plot0 with OpenGL
> -Plot1 without OpenGL
> We found that it was due to float conversion with OpenGL, as far as I
> know we can't safely use doubles with OpenGL since not al GPU/drivers
> support it(and it increase version requirement). So for now it really
> limits plots quality since float has a 23+1 bits mantissa so +/-8M
> relative dynamic.
> For example data with X values representing seconds since epoch(1970)
> would have to store:
> (2016-1970)*365*24*60*60 = 1450656000 seconds ~2^31
> This indeed doesn't fit in 23 bits, to store it in a float you will
> need to truncate it and you would get something close to 3 minutes
> Here is a tool to see what append.
> It will also fail with non uniform X values, packets of data with a
> small dX spaced by bigger dX. For example 8kSps time series grouped in
> packets of 1000 points with few minutes between each packets would
> That said there seems to be solutions to make the situation better.
> I think that before plotting te data we should perform a coordinate
> change to fit float dynamic.
> This pipeline might be implemented like this?:
> CPU: -Data domain analysis (min, max, dynamic)
> CPU: -Produce a Temporary vector of visible data centered and reduced
> CPU: -Push Temporary vector to GPU
> GPU: -Generate Vertices with or without downsampling strategy
> CPU: -Build Axes from visible bounds in data coordinates
That's essentially the same strategy I've implemented in the past. I
don't know the code of Qt Charts or how easily this woudl fit into it
but as an approach I think it's sound.
> Note that this would also work without OpenGL and the downsampling
> insanely increase performances. On QCustomPlot if we replace data
> containers which are QMap by QVector you can plot more than 10M points
> without problems.
> Here is one example with 3M points with QCustomPlot and without OpenGL:
> This would imply to store two coordinate systems for Data and View.
> We are happy to discuss about that and contribute to the development if
> we agree on a solution.
> Anyway I would be happy to have any feedback on this.
> Some readings:
> Best regards
> Alexis Jeandet
> Laboratory of Plasma Physics(LPP)
> Development mailing list
> Development at qt-project.org
Dr Sean Harmer | sean.harmer at kdab.com | Managing Director UK
KDAB (UK) Ltd, a KDAB Group company
Tel. +44 (0)1625 809908; Sweden (HQ) +46-563-540090
Mobile: +44 (0)7545 140604
KDAB - Qt Experts
More information about the Development