diff options
author | Sebastián Barschkis <sebbas@sebbas.org> | 2020-11-26 01:17:47 +0300 |
---|---|---|
committer | Sebastián Barschkis <sebbas@sebbas.org> | 2020-11-26 01:18:12 +0300 |
commit | e09d0c0d077cff79b55ce32ec5124d5faa73e2e7 (patch) | |
tree | 74dd76ecf5016e4b34ffb42b42b7eaae980b44d4 /extern/mantaflow/preprocessed/particle.cpp | |
parent | f7223d5f722ac430041a748248b45c8590c3ffad (diff) |
Fluid: Updated Mantaflow source files
This update introduces two improvements from the Mantaflow repository:
(1) Improved particle sampling:
- Liquid and secondary particles are sampled more predictably. With all parameters being equal, baked particles will be computed at the exact same position during every bake.
- Before, this was not guaranteed.
(2) Sparse grid caching:
- While saving grid data to disk, grids will from now on be saved in a sparse structure whenever possible (e.g. density, flame but not levelsets).
- With the sparse optimization grid cells with a value under the 'Empty Space' value (already present in domain settings) will not be cached.
- The main benefits of this optimization are: Smaller cache sizes and faster playback of simulation data in the viewport.
- This optimization works 'out-of-the-box'. There is no option in the UI to enable it.
- For now, only smoke simulation grids will take advantage of this optimization.
Diffstat (limited to 'extern/mantaflow/preprocessed/particle.cpp')
-rw-r--r-- | extern/mantaflow/preprocessed/particle.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/extern/mantaflow/preprocessed/particle.cpp b/extern/mantaflow/preprocessed/particle.cpp index 05c561e2c60..ad1c344d307 100644 --- a/extern/mantaflow/preprocessed/particle.cpp +++ b/extern/mantaflow/preprocessed/particle.cpp @@ -28,9 +28,15 @@ using namespace std; namespace Manta { -ParticleBase::ParticleBase(FluidSolver *parent) - : PbClass(parent), mMaxParticles(0), mAllowCompress(true), mFreePdata(false) +int ParticleBase::globalSeed = 9832; + +ParticleBase::ParticleBase(FluidSolver *parent, int fixedSeed) + : PbClass(parent), mMaxParticles(0), mAllowCompress(true), mFreePdata(false), mSeed(fixedSeed) { + // use global random seed if none is given + if (fixedSeed == -1) { + mSeed = globalSeed; + } } ParticleBase::~ParticleBase() |