ColorAttachment QML Type
为渲染通道定义颜色附件。更多...
| Import Statement: | import QtQuick3D |
| Since: | Qt 6.11 |
| Inherits: |
属性
详细说明
ColorAttachment 类型用于为RenderPass 指定颜色附件。name 属性用于在渲染通道中识别该附件。如果使用RenderPass.AugmentMaterial 模式,该名称将在片段着色器中作为输出暴露,其名称为name 。
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
}
]
}另请参阅 RenderPassTexture 。
属性文档
name : string
用于在渲染通道中标识此颜色附件的名称。当materialMode 设置为AugmentMaterial 时,该名称将作为片段着色器输出变量暴露出来,从而允许自定义着色器代码向该附件写入数据。
target : RenderPassTexture
将用作颜色附件的RenderPassTexture 。该纹理必须采用与颜色兼容的格式(例如: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.