Reputation: 1
I need to render a native prerendered OpenGL texture in QtQuick application using Qt3D.
I render realtime a scene to a texture bound to a framebuffer using cuda. Then I want to show that rendered texture in the qml scene.
It seems, I have to somehow intervene into a render pass and call glBindTexture() on my texture GLuint.
Of course there is a workaround, I can load the texture from video memory to some buffer, then create QTexture2D and provide the data with QTextureImageDataGenerator. But it seems very inefficient.
So the question is how to bind an existing texture in Qt3D rendering pipeline.
Upvotes: 0
Views: 860
Reputation: 1096
If I understand you correctly, you want to show a video on a texture using Qt3D.
There is an example in your sources, which does exactly that:
<QT_PATH>\5.13.0\Src-Qt5.13.0\qt3d\tests\manual\video-texture-qml
The video memory, you're talking about, is that from a saved video or realtime data? Can you ellaborate on that part?(Answer: realtime to a framebuffer using cuda)
EDIT: have a look at qsharedgltexture They added support for using a textureId from a separate OpenGL context in a Qt 3D scene in Qt13.0. I haven't used it myself yet.
Upvotes: 2