[Bf-blender-cvs] [4a6f715421a] master: Fix T73552: Mantaflow - liquid particles show up in organized unrealistic structure

Sebastián Barschkis noreply at git.blender.org
Wed Apr 8 18:30:28 CEST 2020


Commit: 4a6f715421af0d6cc15dc9e7ab6f3f90438d0a3d
Author: Sebastián Barschkis
Date:   Wed Apr 8 18:29:11 2020 +0200
Branches: master
https://developer.blender.org/rB4a6f715421af0d6cc15dc9e7ab6f3f90438d0a3d

Fix T73552: Mantaflow - liquid particles show up in organized unrealistic structure

Issue was being caused by a particle offset which was random but the same for every particle.

===================================================================

M	extern/mantaflow/preprocessed/gitinfo.h
M	extern/mantaflow/preprocessed/plugin/secondaryparticles.cpp

===================================================================

diff --git a/extern/mantaflow/preprocessed/gitinfo.h b/extern/mantaflow/preprocessed/gitinfo.h
index 6a26c480392..791dd001bbe 100644
--- a/extern/mantaflow/preprocessed/gitinfo.h
+++ b/extern/mantaflow/preprocessed/gitinfo.h
@@ -1,3 +1,3 @@
 
 
-#define MANTA_GIT_VERSION "commit f3d32c45934fd08c40096fb3510e9cc403730977"
+#define MANTA_GIT_VERSION "commit 21303fab2eda588ec22988bf9e5762d2001c131f"
diff --git a/extern/mantaflow/preprocessed/plugin/secondaryparticles.cpp b/extern/mantaflow/preprocessed/plugin/secondaryparticles.cpp
index 23f5e23d99d..a8913a218c1 100644
--- a/extern/mantaflow/preprocessed/plugin/secondaryparticles.cpp
+++ b/extern/mantaflow/preprocessed/plugin/secondaryparticles.cpp
@@ -525,7 +525,7 @@ struct knFlipSampleSecondaryParticlesMoreCylinders : public KernelBase {
     if (!(flags(i, j, k) & itype))
       return;
 
-    RandomStream mRand(9832);
+    static RandomStream mRand(9832);
     Real radius =
         0.25;  // diameter=0.5 => sampling with two cylinders in each dimension since cell size=1
     for (Real x = i - radius; x <= i + radius; x += 2 * radius) {
@@ -791,11 +791,9 @@ struct knFlipSampleSecondaryParticles : public KernelBase {
     const int n = KE * (k_ta * TA + k_wc * WC) * dt;  // number of secondary particles
     if (n == 0)
       return;
-    RandomStream mRand(9832);
+    static RandomStream mRand(9832);
 
-    Vec3 xi = Vec3(i + mRand.getReal(),
-                   j + mRand.getReal(),
-                   k + mRand.getReal());  // randomized offset uniform in cell
+    Vec3 xi = Vec3(i, j, k) + mRand.getVec3();  // randomized offset uniform in cell
     Vec3 vi = v.getInterpolated(xi);
     Vec3 dir = dt * vi;                               // direction of movement of current particle
     Vec3 e1 = getNormalized(Vec3(dir.z, 0, -dir.x));  // perpendicular to dir



More information about the Bf-blender-cvs mailing list