[Bf-blender-cvs] [0c4e3fd9683] fluid-mantaflow: eventually convert bubble snd parts to floats
Sebastián Barschkis
noreply at git.blender.org
Sat Jul 29 00:44:30 CEST 2017
Commit: 0c4e3fd9683485ee6ab68bb93b9238a377cbaa4f
Author: Sebastián Barschkis
Date: Fri Jul 28 21:33:05 2017 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rB0c4e3fd9683485ee6ab68bb93b9238a377cbaa4f
eventually convert bubble snd parts to floats
===================================================================
M intern/mantaflow/intern/manta_pp/omp/plugin/flip.cpp
M intern/mantaflow/intern/manta_pp/tbb/plugin/flip.cpp
===================================================================
diff --git a/intern/mantaflow/intern/manta_pp/omp/plugin/flip.cpp b/intern/mantaflow/intern/manta_pp/omp/plugin/flip.cpp
index 5c2816717a1..91595c5d709 100644
--- a/intern/mantaflow/intern/manta_pp/omp/plugin/flip.cpp
+++ b/intern/mantaflow/intern/manta_pp/omp/plugin/flip.cpp
@@ -753,14 +753,6 @@ void sampleSndParts(BasicParticleSystem& parts, FlagGrid& flags, MACGrid& vel, L
}
}
- // TODO (sebbas): Currently unreliable. Drop particles might get converted into floats to early
-// // Convert bubble to float
-// if (floats && partType[idx] & ParticleBase::PBUBBLE && phiv > -FLOAT_THRESH)
-// {
-// partVel[idx] = vel.getInterpolated( parts[idx].pos ); // floats have fluid vel
-// partType[idx] = ParticleBase::PFLOATER;
-// }
-
// Kill particles depending on type. Especially those that were not converted (see above) to other particle type
if ( partType[idx] & ParticleBase::PDROPLET && phiv < BUBBLE_THRESH ) { parts.kill(idx); continue; }
if ( partType[idx] & ParticleBase::PFLOATER && (phiv > 0. || phiv < -FLOAT_THRESH)) { parts.kill(idx); continue; }
@@ -898,12 +890,19 @@ void sampleSndParts(BasicParticleSystem& parts, FlagGrid& flags, MACGrid& vel, L
// Update forces: gravity and particle velocity
for (IndexInt idx=0; idx<(int)parts.size(); idx++) {
if (parts.isActive(idx)) {
+ Real phiv = phi.getInterpolated( parts.getPos(idx) );
// Update particle type
if (parts.getStatus(idx) & ParticleBase::PNEW) {
partType[idx] = ParticleBase::PFLOATER;
}
+ // TODO (sebbas): Currently unreliable? Drop particles might get converted into floats to early?
+ // Update particle type (convert to float)
+ if (partType[idx] & ParticleBase::PBUBBLE && phiv > -FLOAT_THRESH) {
+ partType[idx] = ParticleBase::PFLOATER;
+ }
+
// Float particles move with fluid flow
if (partType[idx] & ParticleBase::PFLOATER) {
partVel[idx] = vel.getInterpolated( parts[idx].pos );
diff --git a/intern/mantaflow/intern/manta_pp/tbb/plugin/flip.cpp b/intern/mantaflow/intern/manta_pp/tbb/plugin/flip.cpp
index 389bdd9a6d0..9c2727c06f6 100644
--- a/intern/mantaflow/intern/manta_pp/tbb/plugin/flip.cpp
+++ b/intern/mantaflow/intern/manta_pp/tbb/plugin/flip.cpp
@@ -634,14 +634,6 @@ void sampleSndParts(BasicParticleSystem& parts, FlagGrid& flags, MACGrid& vel, L
}
}
- // TODO (sebbas): Currently unreliable. Drop particles might get converted into floats to early
-// // Convert bubble to float
-// if (floats && partType[idx] & ParticleBase::PBUBBLE && phiv > -FLOAT_THRESH)
-// {
-// partVel[idx] = vel.getInterpolated( parts[idx].pos ); // floats have fluid vel
-// partType[idx] = ParticleBase::PFLOATER;
-// }
-
// Kill particles depending on type. Especially those that were not converted (see above) to other particle type
if ( partType[idx] & ParticleBase::PDROPLET && phiv < BUBBLE_THRESH ) { parts.kill(idx); continue; }
if ( partType[idx] & ParticleBase::PFLOATER && (phiv > 0. || phiv < -FLOAT_THRESH)) { parts.kill(idx); continue; }
@@ -779,12 +771,19 @@ void sampleSndParts(BasicParticleSystem& parts, FlagGrid& flags, MACGrid& vel, L
// Update forces: gravity and particle velocity
for (IndexInt idx=0; idx<(int)parts.size(); idx++) {
if (parts.isActive(idx)) {
+ Real phiv = phi.getInterpolated( parts.getPos(idx) );
// Update particle type
if (parts.getStatus(idx) & ParticleBase::PNEW) {
partType[idx] = ParticleBase::PFLOATER;
}
+ // TODO (sebbas): Currently unreliable? Drop particles might get converted into floats to early?
+ // Update particle type (convert to float)
+ if (partType[idx] & ParticleBase::PBUBBLE && phiv > -FLOAT_THRESH) {
+ partType[idx] = ParticleBase::PFLOATER;
+ }
+
// Float particles move with fluid flow
if (partType[idx] & ParticleBase::PFLOATER) {
partVel[idx] = vel.getInterpolated( parts[idx].pos );
More information about the Bf-blender-cvs
mailing list