mirror of
https://github.com/ksherlock/TwoTerm.git
synced 2024-12-21 16:30:24 +00:00
ce666ed1ba
git-svn-id: svn://qnap.local/TwoTerm/trunk@2012 5590a31f-7b70-45f8-8c82-aa3a8e5f4507
25 lines
465 B
Plaintext
25 lines
465 B
Plaintext
/*
|
|
* simulate scanlines by darkening every other line.
|
|
*
|
|
*/
|
|
|
|
kernel vec4 scanline(sampler image, float l, float d)
|
|
{
|
|
vec4 light, dark;
|
|
|
|
vec2 coord = samplerCoord(image);
|
|
vec4 pixel = sample(image, coord);
|
|
pixel = unpremultiply(pixel);
|
|
|
|
light = dark = pixel;
|
|
|
|
|
|
dark.rgb = pixel.rgb * (1.0 - d);
|
|
light.rgb = pixel.rgb * (1.0 - l) + l;
|
|
|
|
pixel.rgb = mod(coord.y, 2.0) < 1.0 ? light.rgb : dark.rgb;
|
|
|
|
|
|
return premultiply(pixel);
|
|
}
|