Qt3DExtras::QMetalRoughMaterial Class
class Qt3DExtras::QMetalRoughMaterialQMetalRoughMaterial 提供了 PBR 照明的默认实现。更多
Header: | #include <QMetalRoughMaterial> |
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 提供了一种在表面上平铺纹理的简单方法。例如,如果纹理比例为4.0
,则会产生 16 个(4x4)平铺。
访问函数
float | textureScale() const |
void | setTextureScale(float textureScale) |
Notifier 信号:
void | textureScaleChanged(float textureScale) |
成员函数文档
[explicit]
QMetalRoughMaterial::QMetalRoughMaterial(Qt3DCore::QNode *parent = nullptr)
使用父对象parent 构建一个新的 QMetalRoughMaterial 实例。
[virtual noexcept]
QMetalRoughMaterial::~QMetalRoughMaterial()
销毁QMetalRoughMaterial 实例。
© 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.