In questa pagina

ColorAttachment QML Type

Definisce un'attribuzione di colore per un passaggio di rendering. Maggiori informazioni...

Import Statement: import QtQuick3D
Since: Qt 6.11
Inherits:

Command

Proprietà

Descrizione dettagliata

Il tipo ColorAttachment viene utilizzato per specificare un allegato di colore per un RenderPass. La proprietà name viene utilizzata per identificare l'allegato all'interno del passaggio di rendering. Se si utilizza la modalità RenderPass.AugmentMaterial, il nome verrà esposto come output con name nel frammento shader.

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
        }
    ]
}

Vedi anche RenderPassTexture.

Documentazione delle proprietà

name : string

Il nome utilizzato per identificare questo allegato di colore all'interno del passaggio di rendering. Quando l'opzione " materialMode " è impostata su " AugmentMaterial", questo nome viene esposto come variabile di output dello shader di frammento, consentendo al codice dello shader personalizzato di scrivere su questo allegato.

target : RenderPassTexture

L'immagine " RenderPassTexture " che verrà utilizzata come allegato di colore. La texture deve essere in un formato compatibile con i colori (ad es. 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.