source: trunk/src/opengl/util/linear_brush.glsl@ 353

Last change on this file since 353 was 2, checked in by Dmitry A. Kuminov, 16 years ago

Initially imported qt-all-opensource-src-4.5.1 from Trolltech.

File size: 423 bytes
Line 
1uniform sampler1D palette;
2uniform vec3 linear;
3uniform vec3 inv_matrix_m0;
4uniform vec3 inv_matrix_m1;
5uniform vec3 inv_matrix_m2;
6
7vec4 brush()
8{
9 mat3 mat;
10
11 mat[0] = inv_matrix_m0;
12 mat[1] = inv_matrix_m1;
13 mat[2] = inv_matrix_m2;
14
15 vec3 hcoords = mat * vec3(gl_FragCoord.xy, 1);
16 vec2 A = hcoords.xy / hcoords.z;
17
18 float val = dot(linear.xy, A) * linear.z;
19
20 return texture1D(palette, val);
21}
22
Note: See TracBrowser for help on using the repository browser.