]> git.sesse.net Git - nageru/blobdiff - sor.frag
Rework patch placement. Finally inches our EPE just below the reference code, it...
[nageru] / sor.frag
index 25f0ce56337732bc4e0206792b8c1ee2307a4351..fc9c462bb5b936f1403592810bbd8212f2a57940 100644 (file)
--- a/sor.frag
+++ b/sor.frag
@@ -35,7 +35,6 @@ void main()
        // (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;
@@ -45,7 +44,10 @@ void main()
        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.