Important: Please read the Qt Code of Conduct -

Qt3D use default depth buffer in a QRenderTarget

  • Hi all,
    Can I reuse the default depth-stencil buffer in a new QRenderTarget? There seems no way to tell a QRenderTargetOutput to use the default draw buffer rather than a QTexture.
    And I've also tried to use QBlitFramebuffer to blit a depth texture from the default back buffer w/o success. I used RenderDoc to trace the frame and it tells that the COLOR_0 attachment is blitted rather than the DEPTH_STENCIL attachment which I've specified. Here's my code,

        auto blit = new Qt3DRender::QBlitFramebuffer(parent);
        blit->setSourceRect(QRectF(0, 0, m_size.width(), m_size.height()));
        blit->setDestinationRect(QRectF(0, 0, m_size.width(), m_size.height()));
        new Qt3DRender::QNoDraw(blit);

Log in to reply