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-- |
// fast painter for composition modes which can be implemented with blendfuncs uniform sampler2D mask_texture; uniform vec2 inv_mask_size; uniform vec2 mask_offset; uniform vec4 mask_channel; float mask() { return dot(mask_channel, texture2D(mask_texture, (gl_FragCoord.xy + mask_offset) * inv_mask_size)); } void main() { // combine clip and coverage channels float mask_alpha = mask(); gl_FragColor = brush() * mask_alpha; }