本页内容

DiffuseMapMaterial QML Type

DiffuseMapMaterial 提供了 Phong 光照效果的默认实现,其中漫反射光成分从纹理贴图中读取。更多内容...

Import Statement: import Qt3D.Extras 2.12
Inherits:

Material

Status: Deprecated

此类型已弃用。我们强烈建议不要在新代码中使用它。

属性

详细说明

镜面光照效果基于环境光、漫反射光和镜面反射光这三个光照组件的组合。这些组件的相对强度通过其反射系数来控制,这些系数以RGB三元组的形式建模:

  • 环境光是指在没有任何其他光源的情况下,物体所发出的颜色。
  • 漫反射是指粗糙表面在光线照射下产生的反射颜色。
  • 镜面反射是指光线在光泽表面反射时呈现的颜色。
  • 表面的光泽度由一个浮点属性控制。

该材质采用单渲染通道的方法,并执行基于片段的照明。提供了适用于 OpenGL 2、OpenGL 3 或更高版本以及 OpenGL ES 2 的技术。

属性文档

ambient : color

保存当前的环境颜色。

diffuse : TextureImage

存储当前用作漫反射贴图的纹理。

默认情况下,漫反射纹理具有以下属性:

  • 线性缩放和放大滤波器
  • 启用米普映射的线性米普图
  • 重复环绕模式
  • 最大各向异性系数为 16.0

shininess : real

保持当前的光泽度。

specular : color

存储当前的镜面颜色。

textureScale : real

保存当前的纹理缩放比例。渲染时,该值将作为乘数应用于纹理坐标。默认值为 1.0。

与 WrapMode.Repeat 结合使用时,textureScale 提供了一种将纹理平铺到整个表面的简便方法。例如,纹理缩放比例为4.0 时,将生成 16 个(4x4)平铺块。

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