- float y_m2 = texture(tex, vec2(tc.x, tc.y - 2.0 * inv_image_size.y)).x;
- float y_m1 = texture(tex, vec2(tc.x, tc.y - inv_image_size.y)).x;
- float y_p1 = texture(tex, vec2(tc.x, tc.y + inv_image_size.y)).x;
- float y_p2 = texture(tex, vec2(tc.x, tc.y + 2.0 * inv_image_size.y)).x;
+ float y_m2 = textureOffset(tex, tc, ivec2( 0, -2)).x;
+ float y_m1 = textureOffset(tex, tc, ivec2( 0, -1)).x;
+ float y_p1 = textureOffset(tex, tc, ivec2( 0, 1)).x;
+ float y_p2 = textureOffset(tex, tc, ivec2( 0, 2)).x;