PySide6.Qt3DRender.Qt3DRender.QDepthTest

class QDepthTest

QDepthTest 类测试片段着色器的深度值与正在写入的样本的深度值。更多

PySide6.Qt3DRender.Qt3DRender.QDepthTest 的继承图

概要

属性

方法

插槽

信号

注意

本文档可能包含从C++自动翻译到Python的代码片段。我们始终欢迎对代码片段翻译的贡献。如果您发现翻译问题,您也可以通过在我们的https:/bugreports.qt.io/projects/PYSIDE上创建工单来告知我们。

详细描述

一个QDepthTest类用于启用具有给定深度测试函数的深度测试。深度测试允许在深度测试通过时写入片段颜色值,并拒绝未通过测试的片段。深度测试使用深度函数来测试片段的深度值与z缓冲区的值。如果底层表面没有z缓冲区,则QDepthTest不执行任何操作。

另请参阅

QAlphaTest QStencilTest

class DepthFunction

深度函数值的枚举

常量

描述

Qt3DRender.QDepthTest.Never

从不通过深度测试

Qt3DRender.QDepthTest.Always

始终通过深度测试

Qt3DRender.QDepthTest.Less

如果片段深度小于z缓冲区值,则通过深度测试

Qt3DRender.QDepthTest.LessOrEqual

如果片段深度小于或等于z缓冲区值,则通过深度测试

Qt3DRender.QDepthTest.Equal

如果片段深度等于z缓冲区值,则通过深度测试

Qt3DRender.QDepthTest.GreaterOrEqual

如果片段深度大于或等于z缓冲区值,则通过深度测试

Qt3DRender.QDepthTest.Greater

如果片段深度大于z缓冲区值,则通过深度测试

Qt3DRender.QDepthTest.NotEqual

如果片段深度不等于z缓冲区值,则通过深度测试

注意

当使用from __feature__ import true_property时,属性可以直接使用,否则通过访问器函数使用。

property depthFunctionᅟ: Qt3DRender.QDepthTest.DepthFunction

保存当前用于深度测试的函数。默认值为Never。

Access functions:
__init__([parent=None])
Parameters:

parentQNode

构造函数使用指定的parent创建一个新的QDepthTest实例。

depthFunction()
Return type:

DepthFunction

另请参阅

setDepthFunction()

属性 depthFunctionᅟ 的获取器。

depthFunctionChanged(depthFunction)
Parameters:

depthFunctionDepthFunction

属性 depthFunctionᅟ 的通知信号。

setDepthFunction(depthFunction)
Parameters:

depthFunctionDepthFunction

另请参阅

depthFunction()

属性 depthFunctionᅟ 的设置器。