Qt3DRender::QAlphaTest Class

class Qt3DRender::QAlphaTest

QAlphaTest 类指定了 alpha 参考测试。更多

头文件: #include <QAlphaTest>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3drender)
target_link_libraries(mytarget PRIVATE Qt6::3drender)
qmake: QT += 3drender
在 QML 中: AlphaTest
继承: Qt3DRender::QRenderState
状态:已废弃

公共类型

enum AlphaFunction { Never, Always, Less, LessOrEqual, Equal, …, NotEqual }

属性

公共功能

Qt3DRender::QAlphaTest::AlphaFunction alphaFunction() const
float referenceValue() const

公共插槽

void setAlphaFunction(Qt3DRender::QAlphaTest::AlphaFunction alphaFunction)
void setReferenceValue(float referenceValue)

信号

void alphaFunctionChanged(Qt3DRender::QAlphaTest::AlphaFunction alphaFunction)
void referenceValueChanged(float referenceValue)

详细说明

正如 OpenGL 文档所解释的那样:alpha 测试根据输入片段的 alpha 值与常量参考值之间的比较结果丢弃片段。

成员类型文档

enum QAlphaTest::AlphaFunction

阿尔法函数值枚举

常数说明
Qt3DRender::QAlphaTest::Never0x0200从不通过阿尔法测试
Qt3DRender::QAlphaTest::Always0x0207始终通过 alpha 检验
Qt3DRender::QAlphaTest::Less0x0201如果片段阿尔法值小于参考值,则通过阿尔法测试
Qt3DRender::QAlphaTest::LessOrEqual0x0203如果片段阿尔法值小于或等于参考值,则通过阿尔法测试
Qt3DRender::QAlphaTest::Equal0x0202如果片段 α 等于参考值,则通过 α 测试
Qt3DRender::QAlphaTest::GreaterOrEqual0x0206如果片段阿尔法大于或等于参考值,则通过阿尔法测试
Qt3DRender::QAlphaTest::Greater0x0204如果片段 α 大于参考值,则通过 α 测试
Qt3DRender::QAlphaTest::NotEqual0x0205如果片段阿尔法值不等于参考值,则通过阿尔法测试

属性文档

alphaFunction : AlphaFunction

保存阿尔法测试使用的阿尔法函数。默认为从不。

访问功能:

Qt3DRender::QAlphaTest::AlphaFunction alphaFunction() const
void setAlphaFunction(Qt3DRender::QAlphaTest::AlphaFunction alphaFunction)

通知信号:

void alphaFunctionChanged(Qt3DRender::QAlphaTest::AlphaFunction alphaFunction)

referenceValue : float

保存阿尔法测试使用的参考值。默认值为 0.0。设置后,该值将在 0 和 1 之间箝位。

访问功能:

float referenceValue() const
void setReferenceValue(float referenceValue)

通知信号:

void referenceValueChanged(float referenceValue)

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