Qt3DExtras::QMetalRoughMaterial Class
class Qt3DExtras::QMetalRoughMaterialQMetalRoughMaterial 提供了 PBR 照明的默认实现。更多内容...
| 标题: | #include <qmetalroughmaterial.h> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS 3dextras) target_link_libraries(mytarget PRIVATE Qt6::3dextras) |
| qmake: | QT += 3dextras |
| 在 QML 中: | MetalRoughMaterial |
| 继承自: | Qt3DRender::QMaterial |
| 状态: | 已弃用 |
该类已弃用。我们强烈建议不要在新代码中使用它。
属性
|
|
公共函数
| QMetalRoughMaterial(Qt3DCore::QNode *parent = nullptr) | |
| virtual | ~QMetalRoughMaterial() |
| QVariant | ambientOcclusion() const |
| QVariant | baseColor() const |
| QVariant | metalness() const |
| QVariant | normal() const |
| QVariant | roughness() const |
| float | textureScale() const |
公共槽位
| void | setAmbientOcclusion(const QVariant &ambientOcclusion) |
| void | setBaseColor(const QVariant &baseColor) |
| void | setMetalness(const QVariant &metalness) |
| void | setNormal(const QVariant &normal) |
| void | setRoughness(const QVariant &roughness) |
| void | setTextureScale(float textureScale) |
信号
| void | ambientOcclusionChanged(const QVariant &ambientOcclusion) |
| void | baseColorChanged(const QVariant &baseColor) |
| void | metalnessChanged(const QVariant &metalness) |
| void | normalChanged(const QVariant &normal) |
| void | roughnessChanged(const QVariant &roughness) |
| void | textureScaleChanged(float textureScale) |
属性文档
ambientOcclusion : QVariant
存储材质当前的环境光遮蔽贴图。此处只能是贴图,否则将被忽略。默认情况下,该贴图未设置。
访问函数:
| QVariant | ambientOcclusion() const |
| void | setAmbientOcclusion(const QVariant &ambientOcclusion) |
通知器信号:
| void | ambientOcclusionChanged(const QVariant &ambientOcclusion) |
baseColor : QVariant
保存材质的当前基础颜色。该值可以是纯色值,也可以是纹理。默认情况下,该属性的值为“灰色”。
访问函数:
| QVariant | baseColor() const |
| void | setBaseColor(const QVariant &baseColor) |
通知信号:
| void | baseColorChanged(const QVariant &baseColor) |
metalness : QVariant
存储材质的当前金属度,数值范围在 0(纯介电,默认值)到 1(纯金属)之间。该值可以是单一的均匀数值,也可以是纹理。默认情况下,该属性的值为 0。
访问函数:
| QVariant | metalness() const |
| void | setMetalness(const QVariant &metalness) |
通知信号:
| void | metalnessChanged(const QVariant &metalness) |
normal : QVariant
存储材质的当前法线贴图。此参数只能是贴图,否则将被忽略。默认情况下,该贴图未设置。
访问函数:
| QVariant | normal() const |
| void | setNormal(const QVariant &normal) |
通知器信号:
| void | normalChanged(const QVariant &normal) |
roughness : QVariant
保存材质的当前粗糙度级别。该值可以是普通的均匀数值,也可以是纹理。默认情况下,该属性的值为 0。
访问函数:
| QVariant | roughness() const |
| void | setRoughness(const QVariant &roughness) |
通知信号:
| void | roughnessChanged(const QVariant &roughness) |
textureScale : float
保存当前的纹理缩放比例。该比例在渲染时作为乘数应用于纹理坐标。默认值为 1.0。
当与 QTextureWrapMode::Repeat 结合使用时,textureScale 提供了一种将纹理平铺到整个表面的简便方法。例如,textureScale 设置为4.0 时,将生成 16 个(4x4)平铺块。
访问函数:
| float | textureScale() const |
| void | setTextureScale(float textureScale) |
通知器信号:
| void | textureScaleChanged(float textureScale) |
成员函数文档
[explicit] QMetalRoughMaterial::QMetalRoughMaterial(Qt3DCore::QNode *parent = nullptr)
创建一个新的 QMetalRoughMaterial 实例,其父对象为parent 。
[virtual noexcept] QMetalRoughMaterial::~QMetalRoughMaterial()
销毁该QMetalRoughMaterial 实例。
© 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.