qskinny
qskinny copied to clipboard
simplified shaders for gradients with less than 2 colors
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.