[Interest] Synchronous update of Qt3D texture data

Sean Harmer sean.harmer at kdab.com
Mon Nov 23 21:57:40 CET 2015


Did https://codereview.qt-project.org/#/c/141786/ help improve things? 
This should enable all such texture (or buffer) updates to be picked up 
on the next frame and uploaded to GL as the render commands are being 
processed that frame.

Cheers,

Sean

On 18/11/2015 22:18, Jørn Bersvendsen wrote:
> I have a QImage which needs to be drawn *synchronously* in 2D 
> (QQuickPaintedItem) and 3D (rendered as texture on a quad). The 
> contents of the QImage changes rapidly (like playing a movie).
>
> Following the Qt3D examples and source code, I'm currently doing the 
> following:
>
> 1. Subclass Qt3DRender::QAbstractTextureImage to represent my texture. 
> My subclass has a Qt3DRender::TexImageDataPtr member that I update 
> with the data from my QImage. So far so good.
> 2. Implement Qt3DRender::QAbstractTextureImage::dataFunctor(), which 
> (through a functor) returns my Qt3DRender::TexImageDataPtr member. 
> This works.
>
> The problem is that the texture loading is asynchronous, and the 3D 
> version of the QImage lags significantly behind the 2D version, and 
> has pretty low update rate. There seem to be two asynchronous parts 
> contributing to this
>
> 1. The Qt3DRender::Render::LoadTextureDataJob, running in a separate 
> thread, checks for updates in my functor, and calls 
> Qt3DRender::Render::Texture::requestTextureDataUpdate, which just 
> marks it as requiring data upload
> 2. The Qt3DRender::QRenderAspect then comes a long (in the next frame, 
> presumably), and uploads the new data to the GPU texture.
>
> Is there a way for me to synchronously upload data to a Qt3D texture?
>
> (Forum post 
> https://forum.qt.io/topic/60703/synchronous-update-of-qt3d-texture-data)
>
>
> Thanks for your advice,
>
> Jørn Bersvendsen
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest


-- 
Dr Sean Harmer | sean.harmer at kdab.com | Managing Director UK
KDAB (UK) Ltd, a KDAB Group company
Tel. +44 (0)1625 809908; Sweden (HQ) +46-563-540090
Mobile: +44 (0)7545 140604
KDAB - Qt Experts

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20151123/9dc612b9/attachment.html>


More information about the Interest mailing list