Qt Scene Grapg(QSG) vs OpenGL(gl function)?
What is the advantages of using Qt Scene Grapg(QSG) against direct using of OpenGL (gl function)?
I mean the advantages of inheritance from QQuickItem against inheritance from QQuickFramebufferObject or some other stuff?
In early Qt versions, Qt uses OpenGL as Scene Graph default back-ends. So we can easily mix both of them without problem.
Recently Qt introduces D3D and Vulkan as alternatives, they may well fit their target platform. For example D3D is usually used for Windows and X-Box platform.
Dear @jiancaiyang ,
When developers can use opengl directly why they should use qsg instead? My main question is that what are the advantages of qsg syntax?
Some good reasons are explained in the first part of the Qt Quick Scene Graph. But basically one of the goodies is that it allows for optimisations to avoid useless rendering that you would otherwise have to calculate by hand thus have better performance for complexe scenes.
@Alien I tested QSG* classes, found it is mainly suitable for 2D tiles, if you are mixing Qt Quick Contents with 3D scenes, you'd better. not use QSG* related classes.
Thank you so much but I've read that QSG can be used for complex 3D mesh,look at :
The most important node for users is the QSGGeometryNode. It is used to define custom graphics by defining its geometry and material. The geometry is defined using QSGGeometry and describes the shape or mesh of the graphical primitive. It can be a line, a rectangle, a polygon, many disconnected rectangles, or complex 3D mesh. The material defines how the pixels in this shape are filled.
I've written a blog post three years ago. You can take a view of it ( You may turn on translator ).