Discussion:
[Interest] Qt3D - Using external Textures from another OpenGL Context
Philip Schuchardt
2016-12-05 18:54:33 UTC
Permalink
I want to render QML to an OpenGL texture through a framebuffer and then
share that texture with Qt3D. Rendering to a framebuffer is fairly straight
forward with a
QQuickRenderControl. A good example of it is in
https://doc.qt.io/qt-5/qtquick-rendercontrol-example.html. Is there any way
to share OpenGL textures between an OpenGL context that I control and the
OpenGL context that qt3d controls? Also, does qt3d use a sperate OpenGL
context than QML scene graph (onscreen)?
--
Phi|ip
Sean Harmer
2016-12-05 18:59:18 UTC
Permalink
Hi,
Post by Philip Schuchardt
I want to render QML to an OpenGL texture through a framebuffer and then
share that texture with Qt3D.
there is a working WIP progress implementation of this on gerrit at:

https://codereview.qt-project.org/#/q/status:open+project:qt/qt3d+branch:wip/qtquickintegration,n,z
Post by Philip Schuchardt
Rendering to a framebuffer is fairly
straight forward with a
QQuickRenderControl.
Yes. The trickier part is mapping events from 3D space through to the
QtQuick scene.
Post by Philip Schuchardt
A good example of it is
in https://doc.qt.io/qt-5/qtquick-rendercontrol-example.html. Is there
any way to share OpenGL textures between an OpenGL context that I
control and the OpenGL context that qt3d controls? Also, does qt3d use a
sperate OpenGL context than QML scene graph (onscreen)?
It depends :) If you have Qt Quick in charge and are embedding Qt 3D
into Qt Quick scene using a Scene3D item, then Qt 3D uses the same GL
context as Qt Quick.

If Qt 3D is in charge it uses it's own context.

With the above series of patches, we use the Qt 3D context to render Qt
Quick using QQuickRenderControl as you mention.

We're hoping to get this into Qt 5.9 but in the meantime you can
cherry-pick those changes to give it a test.

Cheers,

Sean
Post by Philip Schuchardt
--
Phi|ip
_______________________________________________
Interest mailing list
http://lists.qt-project.org/mailman/listinfo/interest
Philip Schuchardt
2016-12-05 19:51:05 UTC
Permalink
Sweet! Sounds interesting. I want to play around with combining QtLocation
(QML Map item), DEMs, and Qt3D to do some simple terrain modeling.
Post by Sean Harmer
Hi,
Post by Philip Schuchardt
I want to render QML to an OpenGL texture through a framebuffer and then
share that texture with Qt3D.
https://codereview.qt-project.org/#/q/status:open+project:qt/qt3d+branch:wip/qtquickintegration,n,z
Post by Philip Schuchardt
Rendering to a framebuffer is fairly
straight forward with a
QQuickRenderControl.
Yes. The trickier part is mapping events from 3D space through to the
QtQuick scene.
Post by Philip Schuchardt
A good example of it is
in https://doc.qt.io/qt-5/qtquick-rendercontrol-example.html. Is there
any way to share OpenGL textures between an OpenGL context that I
control and the OpenGL context that qt3d controls? Also, does qt3d use a
sperate OpenGL context than QML scene graph (onscreen)?
It depends :) If you have Qt Quick in charge and are embedding Qt 3D
into Qt Quick scene using a Scene3D item, then Qt 3D uses the same GL
context as Qt Quick.
If Qt 3D is in charge it uses it's own context.
With the above series of patches, we use the Qt 3D context to render Qt
Quick using QQuickRenderControl as you mention.
We're hoping to get this into Qt 5.9 but in the meantime you can
cherry-pick those changes to give it a test.
Cheers,
Sean
Post by Philip Schuchardt
--
Phi|ip
_______________________________________________
Interest mailing list
http://lists.qt-project.org/mailman/listinfo/interest
_______________________________________________
Interest mailing list
http://lists.qt-project.org/mailman/listinfo/interest
--
Phi|ip
Loading...