QSGVertexColorMaterial Class
QSGVertexColorMaterial 类为在场景图中渲染每个顶点的彩色几何体提供了一种便捷的方法。更多
Header: | #include <QSGVertexColorMaterial> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Quick) target_link_libraries(mytarget PRIVATE Qt6::Quick) |
qmake: | QT += quick |
继承: | QSGMaterial |
- 所有成员(包括继承成员)的列表
- QSGVertexColorMaterial 是Qt Quick 场景图材质类的一部分。
公共函数
详细说明
警告: 该实用程序类仅在运行Qt Quick 场景图的默认后台时有效。
顶点颜色材质将为几何体中的每个顶点赋予一种颜色。顶点之间的像素将进行线性插值。颜色可以包含透明度。
使用顶点颜色渲染的几何体必须具有以下布局。属性位置 0 必须包含顶点。属性位置 1 必须包含颜色,即具有 RGBA 布局的 4 个值的元组。颜色值的有效范围是 0 至 1 的浮点数和 0 至 255 的无符号字节。
注意: 渲染流水线希望像素具有预乘法 alpha 值。
QSGGeometry::defaultAttributes_ColoredPoint2D() 可用于构建与此材质兼容的属性集。
顶点颜色材质在更新渲染状态时,会同时尊重当前不透明度和当前矩阵。
© 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.