本页内容

renderTargetBlend QML Value Type

定义渲染通道中单个颜色附件的混合参数。更多...

Import Statement: import QtQuick3D
Since: Qt 6.11

属性

详细说明

renderTargetBlend 类型用于指定RenderPass 的单个颜色附件的混合参数。renderTargetBlend 的实例可分配给PipelineStateOverride 中的以下属性之一:targetBlend0 至targetBlend7 ,其中索引对应于颜色附件的插槽。

颜色混合方程为:

result.rgb = srcColor * src.rgb  opColor  dstColor * dst.rgb
result.a   = srcAlpha * src.a   opAlpha  dstAlpha * dst.a

属性文档

blendEnabled : bool

如果设置为true ,则启用颜色附件的混合功能。如果设置为false ,则禁用混合功能,输出颜色将直接写入附件。默认值为false 。

colorWrite : enumeration

一个位掩码,用于控制哪些颜色通道将写入颜色附件。多个值可以使用| 运算符组合。默认值为R | G | B | A 。

常量描述
RenderTargetBlend.R写入红色通道。
RenderTargetBlend.G写入绿色通道。
RenderTargetBlend.B写入蓝色通道。
RenderTargetBlend.A写入阿尔法通道。

dstAlpha : enumeration

设置目标透明度混合因子。该值用于在混合操作之前,对颜色附件中当前值的透明度分量进行缩放。默认值为OneMinusSrcAlpha 。可用值列表请参见srcColor 。

dstColor : enumeration

设置目标颜色混合因子。该值用于在混合操作之前对颜色附件中当前值的 RGB 分量进行缩放。默认值为OneMinusSrcAlpha 。可用值的列表请参见srcColor 。

opAlpha : enumeration

设置用于组合缩放后的源和目标透明度分量的算术运算。默认值为Add 。有关可用值的列表,请参阅opColor 。

opColor : enumeration

设置用于组合缩放后的源色和目标色分量的算术运算。默认值为Add 。

常量描述
RenderTargetBlend.Add结果 = 源 + 目标。
RenderTargetBlend.Subtract结果 = src - dst。
RenderTargetBlend.ReverseSubtract结果 = dst - src。
RenderTargetBlend.Min结果 = min(src, dst)。
RenderTargetBlend.Max结果 = max(src, dst)。

srcAlpha : enumeration

设置源透明度混合系数。该值用于在混合操作之前对片段着色器输出的透明度分量进行缩放。默认值为One 。可用值的列表请参见srcColor 。

srcColor : enumeration

设置源颜色混合因子。该值用于在混合操作之前对片段着色器输出的RGB分量进行缩放。默认值为One 。

常量描述
RenderTargetBlend.Zero系数为 (0, 0, 0)。
RenderTargetBlend.One因子为 (0, 0, 0)。
RenderTargetBlend.SrcColor因子为源颜色 (r, g, b)。
RenderTargetBlend.OneMinusSrcColor因子是源色的 (1-r, 1-g, 1-b)。
RenderTargetBlend.DstColor因子是目标颜色 (r, g, b)。
RenderTargetBlend.OneMinusDstColor因子是目标色的 (1-r, 1-g, 1-b)。
RenderTargetBlend.SrcAlpha因子是源图像的透明度 (a, a, a)。
RenderTargetBlend.OneMinusSrcAlpha因子是源的 (1-a, 1-a, 1-a)。
RenderTargetBlend.DstAlpha因子是目标的透明度 (a, a, a)。
RenderTargetBlend.OneMinusDstAlpha因子是目标的 (1-a, 1-a, 1-a)。
RenderTargetBlend.ConstantColor因子是管道上设置的恒定颜色。
RenderTargetBlend.OneMinusConstantColor该因子等于恒定颜色减去1。
RenderTargetBlend.ConstantAlpha因子是常量透明度。
RenderTargetBlend.OneMinusConstantAlpha因子是常量透明度减去 1。
RenderTargetBlend.SrcAlphaSaturate对于 RGB,因子为 min(src.a, 1-dst.a);对于 A,因子为 1。
RenderTargetBlend.Src1Color因子取自片段着色器的第二个颜色输出。
RenderTargetBlend.OneMinusSrc1Color因子等于 1 减去第二个颜色输出。
RenderTargetBlend.Src1Alpha因子是第二个颜色输出的透明度(alpha)。
RenderTargetBlend.OneMinusSrc1Alpha因子等于1减去第二个输出的透明度。

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