Hello, Here a GLSL version of [pix_scanline] with its help patch. Can be integrated everywhere if needed. It could be interesting to have, in the help directory, abstractions with GLSL version of pixes, no ? ++
Jack
glsl_scanline-help.pd
Description: application/puredata
// Jack/RYBN 2013
uniform sampler2DRect tex0;
uniform float interlace, width, mode;
void main() {
float widthOK = width;
float coef = 1.0;
vec2 coord = (gl_TextureMatrix[0] * gl_TexCoord[0]).st;
float interlaceOK = max(1.0,interlace);
coord.t /= interlaceOK;
float fract = fract(coord.t);
coord.t = floor(coord.t);
if (mode == 1.0 && fract > widthOK) coef = 0.0;
coord.t *= interlaceOK;
vec4 color = texture2DRect(tex0, coord);
color.rgb *= coef;
gl_FragColor = color;
}
glsl_scanline.pd
Description: application/puredata
_______________________________________________ GEM-dev mailing list [email protected] http://lists.puredata.info/listinfo/gem-dev
