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不丢弃任何三角形。

depthDrawMode : enumeration

该属性决定是否以及何时对该材质进行深度渲染。当SceneEnvironment::depthTestEnabled 设置为true 时的默认行为是,在主渲染过程中,只有不透明材质会写入深度缓冲区。通过该属性可以改变这种行为,从而对材质的渲染进行微调。

默认值为 Material.OqaqueOnlyDepthDraw

常数说明
Material.OpaqueOnlyDepthDraw只有当材质为不透明时,才会执行深度渲染。
Material.AlwaysDepthDraw无论材质类型如何,始终执行深度渲染。
Material.NeverDepthDraw从不执行深度渲染。
Material.OpaquePrePassDepthDraw在单独的深度传递中执行深度渲染,但只写入不透明值。该模式还可以将透明材质与阴影结合使用。

注: 如果SceneEnvironment::depthPrePassEnabled 设置为true ,那么所有深度写入都将作为深度预传递的结果,但仍有必要明确设置Material.OpaquePrePassDepthDraw ,以便在深度和阴影传递中只写入不透明片段。


lightProbe : Texture

该属性定义了一种 "材质",用于覆盖或设置基于图像的光照 "材质",仅供该材质使用。

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

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

另请参阅 SceneEnvironment::lightProbe


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