Material QML Type
无法创建的材质抽象基类。更多...
| Import Statement: | import Qt3D.Render 2.12 |
| In C++: | QMaterial |
| Inherited By: | DiffuseMapMaterial, DiffuseSpecularMapMaterial, GoochMaterial, NormalDiffuseMapAlphaMaterial, NormalDiffuseMapMaterial, NormalDiffuseSpecularMapMaterial, PerVertexColorMaterial, PhongAlphaMaterial, and PhongMaterial |
| Status: | Deprecated |
此类型已弃用。我们强烈建议不要在新代码中使用它。
属性
- effect : Effect
- parameters : list<Parameter>
详细说明
材质(Material)提供了一种指定entity 渲染效果的方式。任何方面都可以定义其自身的材质子类型,从而利用材质来描述视觉元素;例如,声音应如何从元素上反射、表面的温度等等。
材质本身并不执行任何操作。只有当它引用一个“效果”(Effect)节点时,材质才发挥作用。
实际应用中,常出现单个“效果”(Effect)被多个“材质”(Material)组件引用的情况。这使得只需创建一次效果、技术、通道和着色器,同时通过添加“参数”(Parameter)实例来指定材质。
在材质上定义的参数会覆盖在效果、技术和RenderPass 中定义的(同名)参数,但会被RenderPassFilter 和TechniqueFilter 中的参数覆盖。
Effect {
id: effect
techniques: [
Technique {
id: gl3Technique
graphicsApiFilter {
api: GraphicsApiFilter.OpenGL
profile: GraphicsApiFilter.CoreProfile
majorVersion: 3
minorVersion: 1
}
renderPasses: [
RenderPass {
id: gl3Pass
shaderProgram: ShaderProgram {
...
}
}
]
}
]
}
Material {
id: material1
parameters: [
Parameter { name: "color"; value: "green" }
]
}
Material {
id: material2
parameters: [
Parameter { name: "color"; value: "white" }
]
}另请参阅 Effect 、Technique 和Parameter 。
属性文档
effect : Effect
指定要与该材质配合使用的特效。
parameters : list<Parameter>
存储该材质所使用的参数列表。
© 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.