QDepthTest Class

( Qt3DRender::QDepthTest )

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

头: #include <QDepthTest>
qmake: QT += 3drender
Since: Qt 5.7
实例化: 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 )

额外继承成员

详细描述

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 什么都不做。

另请参阅 QAlphaTest and QStencilTest .

成员类型文档编制

enum QDepthTest:: DepthFunction

Enumeration for the depth function values

常量 描述
Qt3DRender::QDepthTest::Never 0x0200 Never pass depth test
Qt3DRender::QDepthTest::Always 0x0207 Always pass depth test
Qt3DRender::QDepthTest::Less 0x0201 Pass depth test if fragment depth is less than z-buffer value
Qt3DRender::QDepthTest::LessOrEqual 0x0203 Pass depth test if fragment depth is less than or equal to z-buffer value
Qt3DRender::QDepthTest::Equal 0x0202 Pass depth test if fragment depth is equal to z-buffer value
Qt3DRender::QDepthTest::GreaterOrEqual 0x0206 Pass depth test if fragment depth is greater than or equal to z-buffer value
Qt3DRender::QDepthTest::Greater 0x0204 Pass depth test if fragment depth is greater than z-buffer value
Qt3DRender::QDepthTest::NotEqual 0x0205 Pass 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 )

通知程序信号:

void depthFunctionChanged (DepthFunction depthFunction )

成员函数文档编制

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

Default constructs an instance of QDepthTest.