mirror of
https://github.com/ksherlock/TwoTerm.git
synced 2024-12-22 07:30:40 +00:00
04d96f94ce
git-svn-id: svn://qnap.local/TwoTerm/trunk@2004 5590a31f-7b70-45f8-8c82-aa3a8e5f4507
26 lines
428 B
Plaintext
26 lines
428 B
Plaintext
/*
|
|
* simulate scanlines by darkening every other line.
|
|
*
|
|
*/
|
|
|
|
kernel vec4 scanline(sampler image, float strength)
|
|
{
|
|
|
|
vec4 fudge = vec4( 0.4, 0.4, 0.4, 0.0 );
|
|
|
|
vec2 coord = samplerCoord(image);
|
|
vec4 pixel = sample(image, coord);
|
|
|
|
|
|
fudge *= strength;
|
|
|
|
float yy = mod(coord.y, 2.0);
|
|
|
|
fudge *= (yy < 1.0) ? 1.0 : -1.0;
|
|
|
|
pixel = unpremultiply(pixel);
|
|
pixel += fudge;
|
|
return premultiply(pixel);
|
|
|
|
}
|