Qt3DExtras::QMorphPhongMaterial Class
class Qt3DExtras::QMorphPhongMaterialQMorphPhongMaterial 类提供了 Phong 光照效果的默认实现。更多内容...
| 头文件: | #include <qmorphphongmaterial.h> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS 3dextras) target_link_libraries(mytarget PRIVATE Qt6::3dextras) |
| qmake: | QT += 3dextras |
| 继承自: | Qt3DRender::QMaterial |
| 状态: | 已弃用 |
该类已弃用。我们强烈建议在新代码中避免使用它。
属性
|
公共函数
| QMorphPhongMaterial(Qt3DCore::QNode *parent = nullptr) | |
| virtual | ~QMorphPhongMaterial() |
| QColor | ambient() const |
| QColor | diffuse() const |
| float | interpolator() const |
| float | shininess() const |
| QColor | specular() const |
公共槽位
| void | setAmbient(const QColor &ambient) |
| void | setDiffuse(const QColor &diffuse) |
| void | setInterpolator(float interpolator) |
| void | setShininess(float shininess) |
| void | setSpecular(const QColor &specular) |
信号
| void | ambientChanged(const QColor &ambient) |
| void | diffuseChanged(const QColor &diffuse) |
| void | interpolatorChanged(float interpolator) |
| void | shininessChanged(float shininess) |
| void | specularChanged(const QColor &specular) |
详细描述
Phong 光照效果基于环境光、漫反射光和镜面反射光这三个光照成分的组合。这些成分的相对强度通过其反射系数来控制,这些系数以 RGB 三元组的形式建模:
- 环境光是指在没有任何其他光源的情况下,物体所发出的颜色。
- 漫反射是指物体表面在光线照射下产生粗糙反射时发出的颜色。
- 镜面反射是指光线在光泽表面反射时所呈现的颜色。
- 表面的光泽度由一个浮点属性控制。
该材质采用单渲染通道的方法,并执行基于片段的照明计算。提供了适用于 OpenGL 2、OpenGL 3 及以上版本以及 OpenGL ES 2 的技术方案。
属性文档
ambient : QColor
保存环境色。
访问函数:
| QColor | ambient() const |
| void | setAmbient(const QColor &ambient) |
通知信号:
| void | ambientChanged(const QColor &ambient) |
diffuse : QColor
存储漫反射颜色。
访问函数:
| QColor | diffuse() const |
| void | setDiffuse(const QColor &diffuse) |
通知信号:
| void | diffuseChanged(const QColor &diffuse) |
interpolator : float
包含 Phong 光照效果的插值方法。
访问函数:
| float | interpolator() const |
| void | setInterpolator(float interpolator) |
通知信号:
| void | interpolatorChanged(float interpolator) |
shininess : float
存储光泽度指数。
访问函数:
| float | shininess() const |
| void | setShininess(float shininess) |
通知信号:
| void | shininessChanged(float shininess) |
specular : QColor
存储镜面反射颜色。
访问函数:
| QColor | specular() const |
| void | setSpecular(const QColor &specular) |
通知器信号:
| void | specularChanged(const QColor &specular) |
成员函数文档
[explicit] QMorphPhongMaterial::QMorphPhongMaterial(Qt3DCore::QNode *parent = nullptr)
创建一个新的 QMorphPhongMaterial 实例,其父对象为parent 。
[virtual noexcept] QMorphPhongMaterial::~QMorphPhongMaterial()
销毁“QMorphPhongMaterial ”。
© 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.