[Interest] Qt3D - Using external Textures from another OpenGL Context

Sean Harmer sh at theharmers.co.uk
Mon Dec 5 19:59:18 CET 2016


Hi,

On 05/12/2016 18:54, Philip Schuchardt wrote:
> 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


> 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.

> 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

> --
> Phi|ip
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>



More information about the Interest mailing list