本页内容

Material QML Type

提供材料共性功能的抽象基类。更多...

Import Statement: import QtQuick3D
Inherits:

Object3D

Inherited By:

CustomMaterial, DefaultMaterial, PrincipledMaterial, and SpecularGlossyMaterial

属性

详细说明

物业文件

cullMode : enumeration

此属性用于定义是否启用基元剔除,以及在启用时将剔除哪些基元。

默认值为 Material.BackFaceCulling。

如果一个三角形具有逆时针绕行,即其顶点在帧缓冲区坐标系中的顺序为逆时针,则该三角形被视为正面三角形。

常量描述
Material.BackFaceCulling背向三角形将被剔除。
Material.FrontFaceCulling朝向前方的三角形将被舍弃。
Material.NoCulling不剔除任何三角形。

注意:自 Qt 6.12起, 此属性还会影响拾取:在渲染时被剔除的三角形也无法被拾取。当设置为 Material.NoCulling 时,三角形的两面均可被拾取。

另请参阅 View3D.pick()。

depthDrawMode : enumeration

该属性用于确定是否以及何时对该材质进行深度渲染。当SceneEnvironment::depthTestEnabled 设置为true 时,默认行为是在主渲染阶段,仅不透明材质会写入深度缓冲区。通过该属性可以更改此行为,从而对材质的渲染进行精细调整。

默认值为 Material.OpaqueOnlyDepthDraw

常量描述
Material.OpaqueOnlyDepthDraw仅当材质为不透明时才会执行深度渲染。
Material.AlwaysDepthDraw无论材质类型如何,始终执行深度渲染。
Material.NeverDepthDraw绝不执行深度渲染。
Material.OpaquePrePassDepthDraw深度渲染在单独的深度通道中进行,但仅写入不透明值。此模式还允许将透明材质与阴影结合使用。

注意:如果将 SceneEnvironment::depthPrePassEnabled 设置为true ,则所有深度写入都将作为深度预处理的结果进行,但仍需显式设置Material.OpaquePrePassDepthDraw ,以便在深度和阴影处理中仅写入不透明片段。

lightProbe : Texture

此属性定义了一种纹理,用于覆盖或设置仅适用于此材质的基于图像的照明纹理。

注意: 在材质上设置 光探针将覆盖使用此材质模型的scene's light probe 。

注意: 当使用反射探针(Reflection Probe)在采用此材质的模型上显示反射时,此 属性将被忽略,因为反射探针使用的是scene's light probe 。

另请参阅“ SceneEnvironment::lightProbe ”。

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