Sur cette page

ColorAttachment QML Type

Définit un paramètre de couleur pour un passage de rendu. En savoir plus…

Import Statement: import QtQuick3D
Since: Qt 6.11
Inherits:

Command

Propriétés

Description détaillée

Le type ColorAttachment sert à spécifier une pièce jointe de couleur pour un RenderPass. La propriété name permet d'identifier la pièce jointe au sein du passage de rendu. Si le mode RenderPass.AugmentMaterial est utilisé, le nom sera exposé en tant que sortie avec name dans le shader de fragment.

RenderPass {
    // Define a render target texture
    RenderPassTexture {
        id: colorTexture
        format: RenderPassTexture.RGBA16F
    }

    commands: [
        // Define a color attachment using the texture
        ColorAttachment {
            name: "color0"
            target: colorTexture
        }
    ]
}

Voir également RenderPassTexture.

Documentation sur les propriétés

name : string

Nom utilisé pour identifier cet attachement de couleur au sein du passage de rendu. Lorsque le paramètre « materialMode » est défini sur « AugmentMaterial », ce nom est exposé en tant que variable de sortie du shader de fragment, ce qui permet au code du shader personnalisé d'écrire dans cet attachement.

target : RenderPassTexture

L'RenderPassTexture, qui servira de pièce jointe de couleur. La texture doit être au format compatible avec la couleur (par exemple : RGBA8, RGBA16F).

© 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.