QSGVertexColorMaterial Class

The QSGVertexColorMaterial class provides a convenient way of rendering per-vertex colored geometry in the scene graph. More...

Header: #include <QSGVertexColorMaterial>
qmake: QT += quick
Inherits: QSGMaterial.

Public Functions

Detailed Description

The QSGVertexColorMaterial class provides a convenient way of rendering per-vertex colored geometry in the scene graph.

The vertex color material will give each vertex in a geometry a color. Pixels between vertices will be linearly interpolated. The colors can contain transparency.

The geometry to be rendered with vertex color must have the following layout. Attribute position 0 must contain vertices. Attribute position 1 must contain colors, a tuple of 4 values with RGBA layout. Both floats in the range of 0 to 1 and unsigned bytes in the range 0 to 255 are valid for the color values. The QSGGeometry::defaultAttributes_ColoredPoint2D() constructs an attribute set compatible with this material.

The vertex color material respects both current opacity and current matrix when updating it's rendering state.

Member Function Documentation

QSGVertexColorMaterial::​QSGVertexColorMaterial()

Creates a new vertex color material.

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