Sur cette page

DepthTextureAttachment QML Type

Définit une texture de profondeur associée à un objet « pass ». En savoir plus...

Import Statement: import QtQuick3D
Since: Qt 6.11
Inherits:

Command

Propriétés

Description détaillée

DepthTextureAttachment associe une texture de profondeur ( RenderPassTexture ) avec un format de profondeur en tant que tampon de profondeur (depth buffer) pour un tampon de rendu ( RenderPass). Contrairement à la fonction DepthStencilAttachment (qui utilise un tampon de rendu opaque), les données de profondeur obtenues sont stockées dans une texture qui peut être lue par les passes suivantes via la fonction 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
    }
}

Voir également RenderPassTexture, DepthStencilAttachment et RenderOutputProvider.

Documentation sur les propriétés

target : RenderPassTexture

L'RenderPassTexture, qui servira de texture de profondeur. La texture doit être au format compatible avec la profondeur (par exemple : Depth16, Depth24, Depth32 ou 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.