On this page

DepthTextureAttachment QML Type

Defines a depth texture attachment for a pass. More...

Import Statement: import QtQuick3D
Since: Qt 6.11
Inherits:

Command

Properties

Detailed Description

DepthTextureAttachment attaches a RenderPassTexture with a depth format as the depth buffer for a RenderPass. Unlike DepthStencilAttachment (which uses an opaque render buffer), the resulting depth data is stored in a texture that can be read by subsequent passes via RenderOutputProvider.

RenderPassTexture {
    id: depthTexture
    format: RenderPassTexture.Depth24
}

RenderPass {
    commands: [
        ColorAttachment { name: "color0"; target: colorTexture },
        DepthTextureAttachment { target: depthTexture }
    ]
}

// Expose the depth texture to a material via RenderOutputProvider
Texture {
    textureProvider: RenderOutputProvider {
        textureSource: RenderOutputProvider.UserPassTexture
        renderPass: myRenderPass
    }
}

See also RenderPassTexture, DepthStencilAttachment, and RenderOutputProvider.

Property Documentation

target : RenderPassTexture

The RenderPassTexture that will be used as the depth attachment. The texture must have a depth-compatible format (e.g. Depth16, Depth24, Depth32, or Depth24Stencil8).

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.