[GEM-dev] GLSL version of [pix_scanline]

Jack jack at rybn.org
Mon Jul 22 17:19:47 CEST 2013


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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: glsl_scanline-help.pd
Type: application/puredata
Size: 2921 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/gem-dev/attachments/20130722/e9c5bb62/attachment.bin>
-------------- next part --------------
// 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;
}

-------------- next part --------------
A non-text attachment was scrubbed...
Name: glsl_scanline.pd
Type: application/puredata
Size: 767 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/gem-dev/attachments/20130722/e9c5bb62/attachment-0001.bin>


More information about the GEM-dev mailing list