// Compute the pixelwise diff between two textures, one row at a time. // Assumes both images are not transparent. // Warning: Only works on rows <= ((2**8)**4)/255 = 16843009 // try isampler2D, ivec4 etc.? Probably not uniform vec2 size; uniform bool horizontal; // uniform vec2 offs; uniform sampler2D base; uniform sampler2D curr; void main(void) { // calculate total diff of row in either direction float total = 0.0; if (horizontal) { float posy = gl_FragCoord.y/size.y; for (float x=0.0; x