Qt3D use default depth buffer in a QRenderTarget
unclejimbo 0 last edited by unclejimbo 0
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->setSource(nullptr); blit->setSourceAttachmentPoint(Qt3DRender::QRenderTargetOutput::DepthStencil); blit->setSourceRect(QRectF(0, 0, m_size.width(), m_size.height())); blit->setDestination(m_renderTarget); blit->setDestinationAttachmentPoint(Qt3DRender::QRenderTargetOutput::DepthStencil); blit->setDestinationRect(QRectF(0, 0, m_size.width(), m_size.height())); new Qt3DRender::QNoDraw(blit);