[Interest] Custom QQuickItem and Geometry Batching

Andreas Schuller andreas.schuller at student.tugraz.at
Tue Oct 7 12:36:18 CEST 2014


Hi,

I would like to implement a QQuickItem, that draws up to thousand 
objects where each object is composed of a position marker (symbol), a 
framed text label and a line connecting the marker and the label.

For the sake of efficiency, I would like to create a geometry node for 
each type of element (e.g. one node for all lines) and batch together 
the vertices of the lines, markers (realized as point sprites), and 
labels (textured quads).

But doing it this way, the "natural" drawing order (objects should be 
drawn on top of each other) get lost. I would like to utilize the 
z-coordinate of the vertices to preserve the drawing order, e.g. by 
assigning a z-coordinate to each object. But I don't know how to achieve 
this, since the scene graph renderer also makes use of the z-coordinate 
and adjusts the model-view-projection matrix accordingly.

Is it possible to utilize the z-coordinate of the vertices for this 
purpose (within a QuickItem)? Or is there a better solution?

Thanks,

Andreas



More information about the Interest mailing list