From 37ed9122ae6d6e207439c73115810db47cdea490 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sat, 21 Jul 2018 23:38:43 +0200 Subject: [PATCH] Hack around a convergence problem in the SOR code, by stopping the over-relaxation and reverting to pure Gauss-Seidel. --- sor.frag | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sor.frag b/sor.frag index 25f0ce5..6c5333f 100644 --- 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. -- 2.39.2