]> git.sesse.net Git - nageru/commitdiff
Hack around a convergence problem in the SOR code, by stopping the over-relaxation...
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 21 Jul 2018 21:38:43 +0000 (23:38 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 21 Jul 2018 21:38:43 +0000 (23:38 +0200)
sor.frag

index 25f0ce56337732bc4e0206792b8c1ee2307a4351..6c5333fa5ead7c960a96361ae16fd501638d7a6a 100644 (file)
--- a/sor.frag
+++ b/sor.frag
@@ -45,7 +45,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.