Warning, /graphics/krita/krita/data/shaders/linear_gradient.frag is written in an unsupported language. File is not indexed.

0001 /*
0002  *  SPDX-FileCopyrightText: 2007 Adrian Page <adrian@pagenet.plus.com>
0003  *
0004  *  SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 uniform sampler1D gradientColors;
0008 
0009 uniform vec2 gradientVectorStart;
0010 uniform vec2 normalisedGradientVector;
0011 
0012 void main(void)
0013 {
0014     vec2 v = gl_TexCoord[0].st - gradientVectorStart;
0015 
0016     /* Project the vector onto the normalised gradient vector. */
0017     float t = dot(v, normalisedGradientVector);
0018 
0019     gl_FragColor = texture1D(gradientColors, t);
0020 }