author | Eckhart Koeppen <eckhart.koppen@nokia.com> |
Wed, 21 Apr 2010 12:15:23 +0300 | |
branch | RCL_3 |
changeset 12 | cc75c76972ee |
parent 0 | 1918ee327afb |
permissions | -rw-r--r-- |
0 | 1 |
// fast painter for composition modes which can be implemented with blendfuncs |
2 |
||
3 |
uniform sampler2D mask_texture; |
|
4 |
uniform vec2 inv_mask_size; |
|
5 |
uniform vec2 mask_offset; |
|
6 |
uniform vec4 mask_channel; |
|
7 |
||
8 |
float mask() |
|
9 |
{ |
|
10 |
return dot(mask_channel, texture2D(mask_texture, (gl_FragCoord.xy + mask_offset) * inv_mask_size)); |
|
11 |
} |
|
12 |
||
13 |
void main() |
|
14 |
{ |
|
15 |
// combine clip and coverage channels |
|
16 |
float mask_alpha = mask(); |
|
17 |
||
18 |
gl_FragColor = brush() * mask_alpha; |
|
19 |
} |