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. Save QOpenGLFrameBufferObject depth attachment texture as an image
Qt 6.11 is out! See what's new in the release blog

Save QOpenGLFrameBufferObject depth attachment texture as an image

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 336 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
    JesusM
    wrote on last edited by
    #1

    Hi, I am using a QOpenGLFrameBuffer object to calculate a shadow map so, I only need the depth attachment to make a texture with depth values. I want to check that the texture that it is creating is right so I need to get it and save it.
    I tried to do fbo.toImage().save but the image is empty and I think that it is saving the color attachment texture which is correctly empty.
    ¿How can I save the depth attachment texture? I think that when I do fbo.texture() is returning the id of the texture at my depth attachment as I have defined it as the target, but it only returns the id of the texture to use it, fiest i want to check that I am creating correctly it.

    Here is how I created the QOpenGLFrameBuffer:

     shadowFBO = new QOpenGLFramebufferObject(shadowMapWidth,shadowMapHeight,QOpenGLFramebufferObject::Depth,GL_TEXTURE_2D,GL_RGBA);
        bool res = shadowFBO->bind();
    

    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