Qt3DRender::QDepthRange Class

class Qt3DRender::QDepthRange

启用重映射写入深度缓冲区的深度值。更多

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

属性

公共功能

double farValue() const
double nearValue() const

公共插槽

void setFarValue(double value)
void setNearValue(double value)

信号

void farValueChanged(double farValue)
void nearValueChanged(double nearValue)

详细说明

默认情况下,OpenGL 会以 [0.0, 1.0] 的范围将场景深度信息写入深度缓冲区,其中 0.0 对应近剪辑平面,1.0 对应远剪辑平面。QDepthRange 允许将这些值映射到不同的范围,这样场景中的某些部分就会始终呈现在其他部分的前面或后面。近景和远景的有效值介于 0 和 1 之间。

属性文档

farValue : double

与远剪辑平面相对应的深度缓冲区值。有效值介于 0 和 1 之间。

访问功能:

double farValue() const
void setFarValue(double value)

通知信号:

void farValueChanged(double farValue)

nearValue : double

与近剪辑平面相对应的深度缓冲区值。有效值介于 0 和 1 之间。

访问功能:

double nearValue() const
void setNearValue(double value)

通知信号:

void nearValueChanged(double nearValue)

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