本页内容

Qt3DRender::QDepthRange Class

class Qt3DRender::QDepthRange

允许重新映射写入深度缓冲区的深度值。更多...

标题: #include <qdepthrange.h>
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 允许将这些值映射到不同的范围,以便场景的各个部分始终渲染在其他部分的前面或后面。near 和 far 的有效值介于 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)

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