Qt3DRender::QEnvironmentLight Class

class Qt3DRender::QEnvironmentLight

Qt 3D 场景中封装环境光对象。更多

头文件: #include <QEnvironmentLight>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3drender)
target_link_libraries(mytarget PRIVATE Qt6::3drender)
qmake: QT += 3drender
在 QML 中: EnvironmentLight
继承: Qt3DCore::QComponent
状态:已废弃

属性

公共功能

Qt3DRender::QAbstractTexture *irradiance() const
Qt3DRender::QAbstractTexture *specular() const

公共插槽

void setIrradiance(Qt3DRender::QAbstractTexture *irradiance)
void setSpecular(Qt3DRender::QAbstractTexture *specular)

信号

void irradianceChanged(Qt3DRender::QAbstractTexture *environmentIrradiance)
void specularChanged(Qt3DRender::QAbstractTexture *environmentSpecular)

详细说明

QEnvironmentLight 使用立方体贴图来实现基于图像的照明(IBL),这是一种经常与基于物理的渲染(PBR)结合使用的技术。立方体贴图通常应基于高动态范围(HDR)图像,并采用能处理更大数值范围的合适 OpenGL 格式(如 RGBA16F)。

有多种工具可用于生成 QEnvironmentLight 所需的立方体贴图。其中包括

HDRI Haven提供了许多 CC0 许可的 HDR 图像,可用作上述工具的源材料。

属性文档

irradiance : Qt3DRender::QAbstractTexture*

保存当前的环境辐照度贴图纹理。

默认情况下,环境辐照度纹理为空。

注: 此属性的具体含义和使用取决于材质的实现。

访问功能:

Qt3DRender::QAbstractTexture *irradiance() const
void setIrradiance(Qt3DRender::QAbstractTexture *irradiance)

通知信号:

void irradianceChanged(Qt3DRender::QAbstractTexture *environmentIrradiance)

specular : Qt3DRender::QAbstractTexture*

保存当前环境的镜面贴图纹理。

默认情况下,环境镜面贴图纹理为空。

注: 此属性的确切含义和使用取决于材质的实现。

访问函数:

Qt3DRender::QAbstractTexture *specular() const
void setSpecular(Qt3DRender::QAbstractTexture *specular)

通知信号:

void specularChanged(Qt3DRender::QAbstractTexture *environmentSpecular)

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