PDA

View Full Version : Qt 5.5 3D 2.0, is it possible to render in a separate thread other than GUI thread?



guher
4th June 2015, 11:08
Hi,
I have already tried out the solution of Qt 3D 1.0 version's QGLView (is now deprecated) its hard(and seems as impossible without changing QT3D 1.0 source code) to have seperate 3D rendering thread (not blocking UI thread)
In some applications, you might need to have separate 3D rendering thread (when you have video rendering on GUI side and have a 3d renderer on the same application). For such cases, you might need to be able to separate 3D rendering operations away from GUI thread.
Is the Qt 5.5's road map or current feature set supports seperate thread support for QT 3D 2.0 rendering ? (In previous Qt versions, when we use bare QGLWidget, its somehow possible to move the 3D rendering to other thread). I would like to query whether core QT3D 2.0 view classes/components will include the feature of seperate thread? (e.g. an integrative class which makes it available to seperate by inheriting?)

In Qt 5.4 and QT 3D 1.0 version, If the view classes dont inherit from QPaintDevice based classes (e.g. QGLView), i found it that its hard to make them separable since the scene graph nodes expect a QPainter object. But without inheriting from QPaintDevice based classes, i could not establish to create my own painter so which i willuse in painting in other thread. For QT3D 2.0 version, does this dependency still exist? (is it impossible to render advanced 3D view classes in other thread?)


Thank you very much
KR

d_stranz
7th June 2015, 01:32
You should probably be making use of shader programs and the other new OpenGL objects that push much of the rendering into the GPU. In an application written in this way, there should be little if anything done in a paintGL() method.

I have not yet D/L Qt 5.5, so I don't know too much about Qt3D 2.0 yet. I would expect that given Qt's push to support shaders and other OpenGL GPU-side processing in Qt 5.x, Qt 3D 2.0 will have been rewritten to make full use of this. That's one reason why it has taken so long to get into an official release.

wysota
7th June 2015, 09:06
Qt Quick should already render in a different thread (at least on platforms that support it).