QDepthTest Class

(Qt3DRender::QDepthTest)

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

Header: #include <QDepthTest>
qmake: QT += 3drender
Since: Qt 5.7
Instantiated By: DepthTest
Inherits: Qt3DRender::QRenderState

Public Types

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

Properties

Public Functions

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

Public Slots

void setDepthFunction(Qt3DRender::QDepthTest::DepthFunction depthFunction)

Signals

void depthFunctionChanged(Qt3DRender::QDepthTest::DepthFunction depthFunction)

Static Public Members

const QMetaObject staticMetaObject
  • 9 static public members inherited from QObject

Additional Inherited Members

Detailed Description

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.

See also QAlphaTest and QStencilTest.

Member Type Documentation

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

Property Documentation

depthFunction : DepthFunction

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

Access functions:

Qt3DRender::QDepthTest::DepthFunction depthFunction() const
void setDepthFunction(Qt3DRender::QDepthTest::DepthFunction depthFunction)

Notifier signal:

void depthFunctionChanged(Qt3DRender::QDepthTest::DepthFunction depthFunction)

Member Function Documentation

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

The constructor creates a new QDepthTest::QDepthTest instance with the specified parent.

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