[Interest] Custom QQuickItem and Geometry Batching

Andreas Schuller andreas.schuller at student.tugraz.at
Tue Oct 7 15:37:11 CEST 2014


On 10/07/2014 12:46 PM, Gunnar Sletta wrote:
[...]
>> Is it possible to utilize the z-coordinate of the vertices for this
>> purpose (within a QuickItem)? Or is there a better solution?
>
> You have two options. Either you rely on scene graph's internal batching algorithm, (which will probably be sufficient) or you hook your GL up to beforeRendering and do custom GL behind the UI.
>
> If you choose to rely on the internal batching, the only thing you need to take care of is that your lines's materials are equal (QSGMaterial::compare() for all instances will return 0), that your labels compare return 0. The markers need to be changed from point sprites to triangles to allow batching though. We only try to batch GL_TRIANGLE and GL_TRIANGLE_STRIP.

thank you for your advice!

What I haven't mentioned is, that the position of each object changes 
continuously (e.g. every second) and the number of objects varies from 
frame to frame. Additionally, the scene may be rendered in up to 5 windows.

The results of the "Flying Icons" benchmark are impressive. But IHMO, 
creating and maintaining a large tree of small geometry nodes is a bit 
wasteful in my case. Maybe, it's better to do custom GL by using 
QQuickFramebufferObject instead.

Cheers,
Andreas




More information about the Interest mailing list