[Interest] Questions regarding Scene Graph (QSGClipNode, QSGTexture, QSGOpacityNode)

Gunnar Sletta gunnar at sletta.org
Mon May 9 11:31:07 CEST 2016


> On 08 May 2016, at 01:22, Artem Fedoskin <afedoskin3 at gmail.com> wrote:
> 
> 1. Could you tell me please how one can set custom geometry for QSGClipNode (not the rectangular one)? Should I just create QSGeometry with QSGGeometry::defaultAttributes_Point2D() attribute and add vertices? Will Scene Graph recognize that polygon is closed (I need clipping to have a form of circle)?  

You need to add triangles though, not a polygon outline. And when you add triangles, closing the polygon is no longer an issue :)

> 2. If I want to maintain a cache for a bunch of QSGTextures and reuse them for changing texture of QSGSimpleTextureNode how should I delete them? Should I just explicitly delete them in destructor of QSGNode derived object in which I hold them?

Yes, you need to manage them yourself and deleting them from a QSGNode is the most sensible place as QSGNodes will be cleaned up automatically.

> 3. If I set opacity to 0 does this mean that node is not rendered? How is it different from just taking a node out of a node tree?

The approaches should be pretty much the same thing internally.

cheers,
Gunnar

> 
> Regards, Artem Fedoskin
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest




More information about the Interest mailing list