[Bf-blender-cvs] [a3c04bd] fluid-mantaflow: added phi high res grid. will be used later in liquid upres mode
Sebastián Barschkis
noreply at git.blender.org
Thu Jun 9 00:08:14 CEST 2016
Commit: a3c04bdd56c420b1d94ccbb070e0e7598fa143d6
Author: Sebastián Barschkis
Date: Wed Jun 8 22:53:24 2016 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rBa3c04bdd56c420b1d94ccbb070e0e7598fa143d6
added phi high res grid. will be used later in liquid upres mode
===================================================================
M intern/mantaflow/intern/SMOKE.cpp
M intern/mantaflow/intern/SMOKE.h
===================================================================
diff --git a/intern/mantaflow/intern/SMOKE.cpp b/intern/mantaflow/intern/SMOKE.cpp
index 4c41399..62f17f6 100644
--- a/intern/mantaflow/intern/SMOKE.cpp
+++ b/intern/mantaflow/intern/SMOKE.cpp
@@ -112,6 +112,7 @@ SMOKE::SMOKE(int *res, SmokeModifierData *smd)
// Liquids
mPhi = NULL;
+ mPhiHigh = NULL;
// Only start Mantaflow once. No need to start whenever new SMOKE objected is allocated
if (!mantaInitialized)
@@ -390,7 +391,8 @@ SMOKE::~SMOKE()
}
// Liquid
- mPhi = NULL;
+ mPhi = NULL;
+ mPhiHigh = NULL;
// Reset flags
mUsingHeat = false;
@@ -689,6 +691,7 @@ void SMOKE::updatePointers(SmokeModifierData *smd)
{
std::cout << "Updating pointers low res" << std::endl;
+ // Liquid
if (mUsingLiquid) {
mPhi = (float*) getGridPointer("phiTemp", "s");
}
@@ -729,23 +732,31 @@ void SMOKE::updatePointersHigh(SmokeModifierData *smd)
{
std::cout << "Updating pointers high res" << std::endl;
- mDensityHigh = (float*) getGridPointer("xl_density", "xl");
- mTextureU = (float*) getGridPointer("texture_u", "s");
- mTextureV = (float*) getGridPointer("texture_v", "s");
- mTextureW = (float*) getGridPointer("texture_w", "s");
- mTextureU2 = (float*) getGridPointer("texture_u2", "s");
- mTextureV2 = (float*) getGridPointer("texture_v2", "s");
- mTextureW2 = (float*) getGridPointer("texture_w2", "s");
-
- if (mUsingFire) {
- mFlameHigh = (float*) getGridPointer("xl_flame", "xl");
- mFuelHigh = (float*) getGridPointer("xl_fuel", "xl");
- mReactHigh = (float*) getGridPointer("xl_react", "xl");
+ // Liquid
+ if (mUsingLiquid) {
+ // TODO (sebbas) phiInitHigh does not exist yet
+ mPhiHigh = (float*) getGridPointer("phiInitHigh", "xl");
}
- if (mUsingColors) {
- mColorRHigh = (float*) getGridPointer("xl_color_r", "xl");
- mColorGHigh = (float*) getGridPointer("xl_color_g", "xl");
- mColorBHigh = (float*) getGridPointer("xl_color_b", "xl");
+
+ if (mUsingSmoke) {
+ mDensityHigh = (float*) getGridPointer("xl_density", "xl");
+ mTextureU = (float*) getGridPointer("texture_u", "s");
+ mTextureV = (float*) getGridPointer("texture_v", "s");
+ mTextureW = (float*) getGridPointer("texture_w", "s");
+ mTextureU2 = (float*) getGridPointer("texture_u2", "s");
+ mTextureV2 = (float*) getGridPointer("texture_v2", "s");
+ mTextureW2 = (float*) getGridPointer("texture_w2", "s");
+
+ if (mUsingFire) {
+ mFlameHigh = (float*) getGridPointer("xl_flame", "xl");
+ mFuelHigh = (float*) getGridPointer("xl_fuel", "xl");
+ mReactHigh = (float*) getGridPointer("xl_react", "xl");
+ }
+ if (mUsingColors) {
+ mColorRHigh = (float*) getGridPointer("xl_color_r", "xl");
+ mColorGHigh = (float*) getGridPointer("xl_color_g", "xl");
+ mColorBHigh = (float*) getGridPointer("xl_color_b", "xl");
+ }
}
}
diff --git a/intern/mantaflow/intern/SMOKE.h b/intern/mantaflow/intern/SMOKE.h
index 8a52ff6..3671942 100644
--- a/intern/mantaflow/intern/SMOKE.h
+++ b/intern/mantaflow/intern/SMOKE.h
@@ -108,7 +108,8 @@ public:
inline float* getTextureV2() { return mTextureV2; }
inline float* getTextureW2() { return mTextureW2; }
- inline float* getPhi() { return mPhi; }
+ inline float* getPhi() { return mPhi; }
+ inline float* getPhiHigh() { return NULL; } // Not yet implemented
static bool mantaInitialized;
@@ -177,6 +178,7 @@ private:
// Liquids
float* mPhi;
+ float* mPhiHigh;
void initDomain(struct SmokeModifierData *smd);
void initDomainHigh(struct SmokeModifierData *smd);
More information about the Bf-blender-cvs
mailing list