I'm trying to implement a really simple CoreImage Filter, to make lines of the input image go alternately from left>right and right>left, and thought the easiest way to do that would be to use the GLSL mod() function. For some reason though, this doesn't seem to be working. Am I doing something obviously wrong, or is this a bug?

Here's the code:

kernel vec4 alternateLines(sampler image)
{
vec2 xy = samplerCoord(image);
xy.x = (mod(xy.y, 2.0) != 0.0) ?
xy.x :
samplerSize(image).x - xy.x;
return sample(image, xy);
}


QTZ for QC 4 attached.


a|x



Attachment: tb_cifilter_modulo.qtz
Description: application/quartzcomposer

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to