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. 3D Volume Texture in QtQuick3D CustomMaterial

3D Volume Texture in QtQuick3D CustomMaterial

Scheduled Pinned Locked Moved Unsolved General and Desktop
qtquick3dgraphics
4 Posts 3 Posters 879 Views
  • 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
    Jakob Weiss
    wrote on last edited by Jakob Weiss
    #1

    Hi all!

    I am looking into ways to use a 3D volume texture within a QtQuick3D CustomMaterial.
    I want to (dynamically) create a volume texture so I can use it within the fragment shader as a sampler3D.

    So far, I have found the (somewhat) relevant things:

    • TheQCustom3DVolume does not integrate with QtQuick3D at all
    • QSGDynamicTexture is the base class for textures but I could not find anything for 3D textures. So guess I would have to subclass this to implement a 3D texture.
    • QSGTextureProvider would be the class to implement to actually create the texture and bring it into the scene graph. The VulkanTextureImport example shows how to do this on vulkan, but I could not find a corresponding OpenGL example.
    • QQuick3DTextureData seems to be a new Qt6 way to provide dynamic texture data. However, again only 2D.

    So, I am guessing that even if I implement a custom QSGDynamicTexture to create and upload a 3D texture, the CustomMaterial system would try to map it as a 2D texture and provide only a sampler2D to my shader.

    I could not find any information on how to map custom uniforms in a custom material (that way I could manage the 3D texture outside of qml, and just map it in somehow).

    So, does anyone have pointers on how to go about this? It this simply something that is not possible/feasible with QtQuick3D , and I would have to just use the Qt3D or a custom rendering engine instead?
    Any help or pointers to additional resources/examples is greatly appreciated!

    G 1 Reply Last reply
    0
    • J Jakob Weiss

      Hi all!

      I am looking into ways to use a 3D volume texture within a QtQuick3D CustomMaterial.
      I want to (dynamically) create a volume texture so I can use it within the fragment shader as a sampler3D.

      So far, I have found the (somewhat) relevant things:

      • TheQCustom3DVolume does not integrate with QtQuick3D at all
      • QSGDynamicTexture is the base class for textures but I could not find anything for 3D textures. So guess I would have to subclass this to implement a 3D texture.
      • QSGTextureProvider would be the class to implement to actually create the texture and bring it into the scene graph. The VulkanTextureImport example shows how to do this on vulkan, but I could not find a corresponding OpenGL example.
      • QQuick3DTextureData seems to be a new Qt6 way to provide dynamic texture data. However, again only 2D.

      So, I am guessing that even if I implement a custom QSGDynamicTexture to create and upload a 3D texture, the CustomMaterial system would try to map it as a 2D texture and provide only a sampler2D to my shader.

      I could not find any information on how to map custom uniforms in a custom material (that way I could manage the 3D texture outside of qml, and just map it in somehow).

      So, does anyone have pointers on how to go about this? It this simply something that is not possible/feasible with QtQuick3D , and I would have to just use the Qt3D or a custom rendering engine instead?
      Any help or pointers to additional resources/examples is greatly appreciated!

      G Offline
      G Offline
      ghing
      wrote on last edited by
      #2

      @Jakob-Weiss I have exactly the same issue. Qt3D allowed to defined Texture3D Parameters in Shader Effects and thus in the Shader Source Code as sampler3D uniform. If something similar is available for QtQuick3D please let us know.

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

        We could not figure out how to achieve this without pure QtQuick3D without major modifications.. In the end, for this we opted to go with Qt3D instead of QtQuick3D. it seems that Qt3D is more geared towards customizable rendering while QtQuick3D just covers the standard cases and little else.

        1 Reply Last reply
        0
        • H Offline
          H Offline
          hojwm
          wrote on last edited by
          #4
          This post is deleted!
          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