Unsolved SceneGraph vs Qt3D
-
Can someone explain (or point me somewhere that explains...) the differences between SceneGraph and Qt3d, where you would choose what, and how (if) they integrate with each other?
I have been reading blog posts on both SceneGraph and Qt3d, but I still have to find anything that really compares the two, and tell me which one to choose for which kind of use case.
-
Scenegraph supports 2D stuff only (well, 2.5 D because there is
z
order). So all stuff like Rectangle, Item, QtQuick.Controls etc. are rendered by and written for the scenegraph.Qt3D is for building 3D scenes and types it supports are completely different: https://doc.qt.io/qt-5/qt3d-index.html.
There is no blog that compares the two because they are completely different; there is nothing to compare.
-
@sierdzio
That's interesting because the (5.12.5) docs say:
"Even though the node tree is mostly built internally by the existing Qt Quick QML types, it is possible for users to also add complete subtrees with their own content, including subtrees that represent 3D models. " (emphasis mine)In the introduction to SceneGraph, the limitation to 2D is only mentioned for QPainter-based items.
EDIT: Plus, the Qt3d introduction list as the first basic feature:
"2D and 3D rendering for C++ and Qt Quick applications" -
@Asperamanca said in SceneGraph vs Qt3D:
@sierdzio
That's interesting because the (5.12.5) docs say:
"Even though the node tree is mostly built internally by the existing Qt Quick QML types, it is possible for users to also add complete subtrees with their own content, including subtrees that represent 3D models. " (emphasis mine)In the introduction to SceneGraph, the limitation to 2D is only mentioned for QPainter-based items.
Yes, but do any regular QtQuick components render anything in 3D? No. So it is a possibility, but mostly unused, perhaps even untested.
EDIT: Plus, the Qt3d introduction list as the first basic feature:
"2D and 3D rendering for C++ and Qt Quick applications"It's possible to mix Qt3D with normal (2D) QtQuick, by means of rendering the 2D content into a texture. See https://doc.qt.io/qt-5/qt3d-scene2d-example.html#
So I'll still say these two are completely different.
-
@sierdzio
You could say C++ and SCALA are completely different. It doesn't help me to decide which one is the better choice for my use case.- I need to be able to render 2D drawing with high performance.
- I want to include standardized components (e.g. buttons, text, graphics) and layout them nicely
- EDIT: User interaction with mouse, keyboard, touch and gestures
- I prefer to use C++ only, but I am considering QML
- I'd rather not open the can called JavaScript
All of that, I have previously done in GraphicsView. But it's starting to get gray hair and wrinkles.
-
For 2D drawing (of custom shapes, I assume), QWidgets are still the best (IMO) and fastest, so I'd recommend sticking with QPainter.
Qt3D won't help you at all with these requirements, you do not need any 3D capability.
I'd rather not open the can called JavaScript
Then wait for Qt 6, it will have QML with C++ bindings - less or no JavaScript.
-
@sierdzio said in SceneGraph vs Qt3D:
For 2D drawing (of custom shapes, I assume), QWidgets are still the best (IMO) and fastest, so I'd recommend sticking with QPainter.
Qt3D won't help you at all with these requirements, you do not need any 3D capability.
I'd rather not open the can called JavaScript
Then wait for Qt 6, it will have QML with C++ bindings - less or no JavaScript.
I'm painting curve displays with 100k+ points on embedded hardware. I need a little more performance than QWidget can offer.
-
@Asperamanca If your device supports OpenGL you can take a look at OpenGL integration in Qt https://doc.qt.io/qt-5/qtgui-index.html
-
@jsulm said in SceneGraph vs Qt3D:
@Asperamanca If your device supports OpenGL you can take a look at OpenGL integration in Qt https://doc.qt.io/qt-5/qtgui-index.html
Nothing like throwing a 3rd option at a person who cannot decide between two others :)
I like the fact that SceneGraph plans to introduce an abstraction layer that will allow it to run on other graphics libraries in the future. OpenGL is widely supported, but I feel the time is ticking there, too. I'm not yet sure what level of abstraction Qt3d offers or plans to offer.
-
@Asperamanca said in SceneGraph vs Qt3D:
Nothing like throwing a 3rd option at a person who cannot decide between two others :)
Well, you wrote: "I'm painting curve displays with 100k+ points". This sounds like you need something really fast and that is what OpenGL is good for :-) And you can do 2D just fine with OpenGL. Just a suggestion...
-
@jsulm said in SceneGraph vs Qt3D:
@Asperamanca said in SceneGraph vs Qt3D:
Nothing like throwing a 3rd option at a person who cannot decide between two others :)
Well, you wrote: "I'm painting curve displays with 100k+ points". This sounds like you need something really fast and that is what OpenGL is good for :-) And you can do 2D just fine with OpenGL. Just a suggestion...
I know. I already wrote a component for that years ago, but that was with OpenGL 1.2 and in Visual Basic...still, it could paint 100k points like nothing
-
@jsulm
A question to that came up over the weekend: What's the advantage of QtOpenGL compared to Qt3d (which at the moment seems to be based on OpenGL as well)? -
@Asperamanca said in SceneGraph vs Qt3D:
What's the advantage of QtOpenGL compared to Qt3d (which at the moment seems to be based on OpenGL as well)?
OpenGL is low-level; Qt 3D is high-level. Think of Assembly vs. C++.
OpenGL gives you the full flexibility to write any kind of graphical code you can imagine. However, it is time consuming to use.
Qt 3D makes it quick and easy for you to produce certain types of 3D graphics. However, it is less flexible than pure OpenGL so you might run into restrictions on what you can produce.
Note, the Qt OpenGL module with classes like
QGLWidget
is deprecated. It is replaced by classes likeQOpenGLWidget
in the Qt GUI module.