QDepthTest Class

(Qt3DRender::QDepthTest)

The QDepthTest class tests the fragment shader's depth value against the depth of a sample being written to. 更多...

头文件: #include <QDepthTest>
qmake: QT += 3drender
开始支持版本: Qt 5.7
Instantiated By: DepthTest
基类: Qt3DRender::QRenderState

公有类型

enum DepthFunction { Never, Always, Less, LessOrEqual, ..., NotEqual }

属性

公有函数

QDepthTest(Qt3DCore::QNode *parent = nullptr)
DepthFunction depthFunction() const

公有槽函数

void setDepthFunction(DepthFunction depthFunction)

信号

void depthFunctionChanged(DepthFunction depthFunction)

其他继承的成员

详细描述

The QDepthTest class tests the fragment shader's depth value against the depth of a sample being written to.

A QDepthTest class is used to enable depth testing with a given depth test function. The depth test enables writing fragment color values when the depth test passes, and reject fragments which fail the test. The depth test uses the depth function to test the fragments depth value to the value against z-buffer. If the underlying surface does not have z-buffer, then QDepthTest does nothing.

参见 QAlphaTest and QStencilTest.

成员类型

enum QDepthTest::DepthFunction

Enumeration for the depth function values

ConstantValueDescription
Qt3DRender::QDepthTest::Never0x0200Never pass depth test
Qt3DRender::QDepthTest::Always0x0207Always pass depth test
Qt3DRender::QDepthTest::Less0x0201Pass depth test if fragment depth is less than z-buffer value
Qt3DRender::QDepthTest::LessOrEqual0x0203Pass depth test if fragment depth is less than or equal to z-buffer value
Qt3DRender::QDepthTest::Equal0x0202Pass depth test if fragment depth is equal to z-buffer value
Qt3DRender::QDepthTest::GreaterOrEqual0x0206Pass depth test if fragment depth is greater than or equal to z-buffer value
Qt3DRender::QDepthTest::Greater0x0204Pass depth test if fragment depth is greater than z-buffer value
Qt3DRender::QDepthTest::NotEqual0x0205Pass depth test if fragment depth is not equal to z-buffer value

属性

depthFunction : DepthFunction

Holds the current function used by depth test. The default is Never.

访问函数:

DepthFunction depthFunction() const
void setDepthFunction(DepthFunction depthFunction)

Notifier signal:

void depthFunctionChanged(DepthFunction depthFunction)

成员函数

QDepthTest::QDepthTest(Qt3DCore::QNode *parent = nullptr)

Default constructs an instance of QDepthTest.