// (it couldn't be done earlier, because we didn't know
// the values of the neighboring pixels; they change for
// each SOR iteration).
- // TODO: Multiply by some gamma.
float smooth_l = textureOffset(smoothness_x_tex, tc, ivec2(-1, 0)).x;
float smooth_r = texture(smoothness_x_tex, tc).x;
float smooth_d = textureOffset(smoothness_y_tex, tc, ivec2( 0, -1)).x;
b += smooth_d * textureOffset(diff_flow_tex, tc, ivec2( 0, -1)).xy;
b += smooth_u * textureOffset(diff_flow_tex, tc, ivec2( 0, 1)).xy;
- const float omega = 1.6;
+ // FIXME: omega=1.6 seems to make our entire system diverge.
+ // Is this because we do Gauss-Seidel instead of Jacobi?
+ // Figure out what's going on.
+ const float omega = 1.0;
diff_flow = texture(diff_flow_tex, tc).xy;
// From https://en.wikipedia.org/wiki/Successive_over-relaxation.