本页内容

Qt3DRender::QEnvironmentLight Class

class Qt3DRender::QEnvironmentLight

在Qt 3D 场景中封装一个环境光对象。更多内容...

标题: #include <qenvironmentlight.h>
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)

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