Qt3DRender::QPolygonOffset Class

class Qt3DRender::QPolygonOffset

QPolygonOffset 类设置了计算多边形偏移深度值的比例和步骤。更多

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

属性

公共功能

QPolygonOffset(Qt3DCore::QNode *parent = nullptr)
float depthSteps() const
float scaleFactor() const

公共插槽

void setDepthSteps(float depthSteps)
void setScaleFactor(float scaleFactor)

信号

void depthStepsChanged(float depthSteps)
void scaleFactorChanged(float scaleFactor)

详细说明

QPolygonOffset 类可在深度测试和深度写入之前为片段深度值添加偏移量。在渲染深度值非常接近的多边形(如贴花)时,偏移量可用于避免z-fighting。

属性文档

depthSteps : float

保存创建恒定深度偏移的单位。默认值为 0。

访问功能:

float depthSteps() const
void setDepthSteps(float depthSteps)

通知信号:

void depthStepsChanged(float depthSteps)

scaleFactor : float

保存用于为每个多边形创建可变深度偏移的比例因子。默认值为 0。

访问功能:

float scaleFactor() const
void setScaleFactor(float scaleFactor)

通知信号:

void scaleFactorChanged(float scaleFactor)

成员函数 文档

[explicit] QPolygonOffset::QPolygonOffset(Qt3DCore::QNode *parent = nullptr)

构造函数创建一个新的QPolygonOffset::QPolygonOffset 实例,该实例具有指定的parent

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