author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 26 Jan 2010 12:42:25 +0200 | |
changeset 2 | 56cd8111b7f7 |
parent 0 | 1918ee327afb |
permissions | -rw-r--r-- |
0 | 1 |
uniform sampler2D brush_texture; |
2 |
uniform vec2 inv_brush_texture_size; |
|
3 |
uniform vec3 inv_matrix_m0; |
|
4 |
uniform vec3 inv_matrix_m1; |
|
5 |
uniform vec3 inv_matrix_m2; |
|
6 |
||
7 |
vec4 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 coords = hcoords.xy / hcoords.z; |
|
17 |
||
18 |
coords *= inv_brush_texture_size; |
|
19 |
||
20 |
return texture2D(brush_texture, coords); |
|
21 |
} |