[Bf-blender-cvs] [60859d8912b] blender-v2.91-release: Fluid: Potential fix for T74559: Adaptive Domain creates lines in smoke

Sebastián Barschkis noreply at git.blender.org
Thu Nov 5 19:18:35 CET 2020


Commit: 60859d8912bdeff6b61232daf3561dafa31829ae
Author: Sebastián Barschkis
Date:   Thu Nov 5 15:05:30 2020 +0100
Branches: blender-v2.91-release
https://developer.blender.org/rB60859d8912bdeff6b61232daf3561dafa31829ae

Fluid: Potential fix for T74559: Adaptive Domain creates lines in smoke

This commit corrects the maximum resolution field in Fluid objects. The field should be set to the maximum possible resolution, i.e. it should not adjust with adaptive domains and stay constant all the time.

The reason for this is that this resolution value will be used to scale gravity. And this gravity should be constant for adaptive domains too.

It remains to be shown if this issue was the only reason for line-artifacts as seen in T74559.

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

M	intern/mantaflow/intern/MANTA_main.cpp
M	intern/mantaflow/intern/MANTA_main.h

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

diff --git a/intern/mantaflow/intern/MANTA_main.cpp b/intern/mantaflow/intern/MANTA_main.cpp
index e15fe809b2d..dec05831e61 100644
--- a/intern/mantaflow/intern/MANTA_main.cpp
+++ b/intern/mantaflow/intern/MANTA_main.cpp
@@ -56,7 +56,8 @@ using std::to_string;
 atomic<int> MANTA::solverID(0);
 int MANTA::with_debug(0);
 
-MANTA::MANTA(int *res, FluidModifierData *fmd) : mCurrentID(++solverID)
+MANTA::MANTA(int *res, FluidModifierData *fmd)
+    : mCurrentID(++solverID), mMaxRes(fmd->domain->maxres)
 {
   if (with_debug)
     cout << "FLUID: " << mCurrentID << " with res(" << res[0] << ", " << res[1] << ", " << res[2]
@@ -85,11 +86,10 @@ MANTA::MANTA(int *res, FluidModifierData *fmd) : mCurrentID(++solverID)
   mUsingInvel = (fds->active_fields & FLUID_DOMAIN_ACTIVE_INVEL);
   mUsingOutflow = (fds->active_fields & FLUID_DOMAIN_ACTIVE_OUTFLOW);
 
-  /* Simulation constants. */
-  mResX = res[0];
+  /* Simulation constants */
+  mResX = res[0]; /* Current size of domain (will adjust with adaptive domain). */
   mResY = res[1];
   mResZ = res[2];
-  mMaxRes = MAX3(mResX, mResY, mResZ);
   mTotalCells = mResX * mResY * mResZ;
   mResGuiding = fds->res;
 
diff --git a/intern/mantaflow/intern/MANTA_main.h b/intern/mantaflow/intern/MANTA_main.h
index 68a5b427e7d..6425614cf4b 100644
--- a/intern/mantaflow/intern/MANTA_main.h
+++ b/intern/mantaflow/intern/MANTA_main.h
@@ -38,7 +38,6 @@ using std::vector;
 struct MANTA {
  public:
   MANTA(int *res, struct FluidModifierData *fmd);
-  MANTA(){};
   virtual ~MANTA();
 
   /* Mirroring Mantaflow structures for particle data (pVel also used for mesh vert vels). */
@@ -745,7 +744,7 @@ struct MANTA {
   unordered_map<string, string> mRNAMap;
 
   /* The ID of the solver objects will be incremented for every new object. */
-  int mCurrentID;
+  const int mCurrentID;
 
   bool mUsingHeat;
   bool mUsingColors;
@@ -775,7 +774,7 @@ struct MANTA {
   int mResX;
   int mResY;
   int mResZ;
-  int mMaxRes;
+  const int mMaxRes;
 
   int mResXNoise;
   int mResYNoise;



More information about the Bf-blender-cvs mailing list