Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to access depth buffer of a QQuickWindow app?
Forum Updated to NodeBB v4.3 + New Features

How to access depth buffer of a QQuickWindow app?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 216 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.
  • G Offline
    G Offline
    GamerSC
    wrote on last edited by
    #1

    Hi, in a project I need to access the depth buffer of a Qt Quick application. I have read docs of QQuickRenderControl and QOpenGLFramebufferObject.
    But I am not sure what is the correct approach to get the depth buffer, or even if possible to achieve with QML.

    In principle, I'd like to render the whole application to a custom framebuffer with color and depth texture so I could apply some postprocessing to both of the textures after the QML rendering. But I don't have enough Qt/QML knowledge to do that.

    QQuickWindow exposes QQuickRenderTarget but QQuickRenderTarget does not expose the underlying depth buffer. So the QQuickRenderControl example does not apply to my use case, I think.

    I have also checked the Rendering FBOs example. However, I am not sure if I can include other QML elements in the framebuffer item. I asked chatGPT and it said no.

    I also tried to directly access the default framebuffer in a slot connected to QQuickWindow::afterRendering(). But OpenGL always returns error code GL_INVALID_ENUM, no matter what parameters I pass the function glGetFramebufferAttachmentParameteriv.

    Any advice will be appreciated! Thanks.

    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