blob: f5c669b0607e8c249f79bd205ffa6510ef192f2c [file] [log] [blame]
Romain Guyf9764a42010-07-16 23:13:33 -07001SHADER_SOURCE(gDrawLinearGradientVertexShader,
2
3attribute vec4 position;
4
5uniform float gradientLength;
6uniform vec2 gradient;
Romain Guyc0ac1932010-07-19 18:43:02 -07007uniform vec2 start;
Romain Guyf9764a42010-07-16 23:13:33 -07008uniform mat4 transform;
Romain Guyc0ac1932010-07-19 18:43:02 -07009uniform mat4 screenSpace;
Romain Guyf9764a42010-07-16 23:13:33 -070010
11varying float index;
12
13void main(void) {
Romain Guyc0ac1932010-07-19 18:43:02 -070014 vec4 location = screenSpace * position;
15 index = dot(location.xy - start, gradient) * gradientLength;
16
Romain Guyf9764a42010-07-16 23:13:33 -070017 gl_Position = transform * position;
Romain Guyf9764a42010-07-16 23:13:33 -070018}
19
20);