DepthTextureAttachment QML Type | Qt Quick 3D | Qt 6.12.0
Description: Defines a depth texture attachment for a pass.
Keywords: qmltype

- Qt 6.12
- Qt Quick 3D
- QML Types
- DepthTextureAttachment
- Qt Quick 3D | Commercial or GPLv3

# DepthTextureAttachment QML Type

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

Import Statement: | `import QtQuick3D`
Since: | Qt 6.11
Inherits: | Command

- List of all members, including inherited members

## Properties

- target : RenderPassTexture

## 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`).