QSGVertexColorMaterial#

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

Inheritance diagram of PySide6.QtQuick.QSGVertexColorMaterial

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description#

Warning

This utility class is only functional when running with the default backend of the Qt Quick scenegraph.

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.

Note

The rendering pipeline expects pixels with premultiplied alpha.

defaultAttributes_ColoredPoint2D() can be used to construct an attribute set that is compatible with this material.

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

class PySide6.QtQuick.QSGVertexColorMaterial#

Creates a new vertex color material.