Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Synchronous update of Qt3D texture data
Forum Updated to NodeBB v4.3 + New Features

Synchronous update of Qt3D texture data

Scheduled Pinned Locked Moved Unsolved General and Desktop
qt3dqt3d 2.0opengl
3 Posts 2 Posters 2.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jornb
    wrote on last edited by
    #1

    Use case

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

    Current solution

    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.

    Problem

    The problem is that the texture loading is asynchronous, and the 3D version of the QImage lags significantly behind the 2D version. 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.

    TL;DR

    Is there a way for me to synchronously upload data to a Qt3D texture?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Since Qt3D (2.0) is pretty new, I'd recommend asking this question on the interest mailing list. You'll find there Qt3D's developers/maintainers (this forum is more user oriented)

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jornb
        wrote on last edited by
        #3

        Thanks, I'll do that!

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved