mirror of
https://github.com/ksherlock/TwoTerm.git
synced 2024-12-21 16:30:24 +00:00
updated ScanLine Filter
git-svn-id: svn://qnap.local/TwoTerm/trunk@2012 5590a31f-7b70-45f8-8c82-aa3a8e5f4507
This commit is contained in:
parent
f18c3a6284
commit
ce666ed1ba
@ -3,23 +3,22 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
kernel vec4 scanline(sampler image, float strength)
|
kernel vec4 scanline(sampler image, float l, float d)
|
||||||
{
|
{
|
||||||
|
vec4 light, dark;
|
||||||
vec4 fudge = vec4( 0.4, 0.4, 0.4, 0.0 );
|
|
||||||
|
|
||||||
vec2 coord = samplerCoord(image);
|
vec2 coord = samplerCoord(image);
|
||||||
vec4 pixel = sample(image, coord);
|
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 = unpremultiply(pixel);
|
||||||
pixel += fudge;
|
|
||||||
return premultiply(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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user