uwerat / qskinny

A lightweight framework on top of the Qt scene graph and only few classes from Qt/Quick. It is usable from C++ and/or QML.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

simplified shaders for gradients with less than 2 colors

uwerat opened this issue · comments

commented

It might be good to have specific shaders for gradients made of 2 colors or less - a very common use case. These shaders do not need precalculated color ramps ( -> textures ) as such an interpolation ( https://registry.khronos.org/OpenGL-Refpages/gl4/html/mix.xhtml ) can be done easily in the shader code.

For shapes/strokes with linear gradients it would be enough to use a QSGGeometry::ColoredPoint2D geometry. The color parameter can be calculated in QskShapeNode/QskStrokeNode using a QskBox::ColorMap.