diff options
author | Sriharsha Kotcharlakot <k.venkatsriharsha@gmail.com> | 2020-09-15 18:51:14 +0300 |
---|---|---|
committer | Sriharsha Kotcharlakot <k.venkatsriharsha@gmail.com> | 2020-09-15 20:43:01 +0300 |
commit | f137022f9919f4dd315ec6b325a08e1bf5aec6fb (patch) | |
tree | 4b15aa230eb100e77b41dfffb8ef5e7501c55db5 /intern | |
parent | bedbd8655ed1d331aeaf756874c46dbed93168a1 (diff) |
Liquid Simulation Display Options (GSoC 2020)
All the changes made in the branch `soc-2020-fluid-tools` are included in this patch.
**Major changes:**
=== Viewport Display ===
- //Raw voxel display// or //closest (nearest-neighbor)// interpolation for displaying the underlying voxel data of the simulation grids more clearly.
- An option to display //gridlines// when the slicing method is //single//.
==== Grid Display ====
- Visualization for flags, pressure and level-set representation grids with a fixed color coding based on Manta GUI.
==== Vector Display ====
- //**M**arker **A**nd **C**ell// grid visualization options for vector grids like velocity or external forces.
- Made vector display options available for external forces.
==== Coloring options for //gridlines// ====
- Range highlighting and cell filtering options for displaying the simulation grid data more precisely.
- Color gridlines with flags.
- Also, made slicing and interpolation options available for Volume Object.
Reviewed By: JacquesLucke, sebbas
Differential Revision: https://developer.blender.org/D8705
Diffstat (limited to 'intern')
-rw-r--r-- | intern/mantaflow/extern/manta_fluid_API.h | 2 | ||||
-rw-r--r-- | intern/mantaflow/intern/MANTA_main.cpp | 2 | ||||
-rw-r--r-- | intern/mantaflow/intern/MANTA_main.h | 5 | ||||
-rw-r--r-- | intern/mantaflow/intern/manta_fluid_API.cpp | 8 | ||||
-rw-r--r-- | intern/opencolorio/ocio_impl_glsl.cc | 5 |
5 files changed, 20 insertions, 2 deletions
diff --git a/intern/mantaflow/extern/manta_fluid_API.h b/intern/mantaflow/extern/manta_fluid_API.h index 124671467f7..6827ac35050 100644 --- a/intern/mantaflow/extern/manta_fluid_API.h +++ b/intern/mantaflow/extern/manta_fluid_API.h @@ -109,6 +109,8 @@ float *manta_get_phiobs_in(struct MANTA *fluid); float *manta_get_phiobsstatic_in(struct MANTA *fluid); float *manta_get_phiout_in(struct MANTA *fluid); float *manta_get_phioutstatic_in(struct MANTA *fluid); +float *manta_get_phi(struct MANTA *fluid); +float *manta_get_pressure(struct MANTA *fluid); /* Smoke functions */ void manta_smoke_export_script(struct MANTA *smoke, struct FluidModifierData *fmd); diff --git a/intern/mantaflow/intern/MANTA_main.cpp b/intern/mantaflow/intern/MANTA_main.cpp index 8d92d616e15..9d5b3efb0bc 100644 --- a/intern/mantaflow/intern/MANTA_main.cpp +++ b/intern/mantaflow/intern/MANTA_main.cpp @@ -118,6 +118,7 @@ MANTA::MANTA(int *res, FluidModifierData *fmd) : mCurrentID(++solverID) mFuelIn = nullptr; mReactIn = nullptr; mEmissionIn = nullptr; + mPressure = nullptr; /* Smoke high res grids. */ mDensityHigh = nullptr; @@ -2020,6 +2021,7 @@ void MANTA::updatePointers(FluidModifierData *fmd, bool flush) mForceX = (smoke || liquid) ? getPointer<float>("x_force" + s_ext, func) : nullptr; mForceY = (smoke || liquid) ? getPointer<float>("y_force" + s_ext, func) : nullptr; mForceZ = (smoke || liquid) ? getPointer<float>("z_force" + s_ext, func) : nullptr; + mPressure = (smoke || liquid) ? getPointer<float>("pressure" + s_ext, func) : nullptr; /* Outflow. */ mPhiOutIn = (outflow) ? getPointer<float>("phiOutIn" + s_ext, func) : nullptr; diff --git a/intern/mantaflow/intern/MANTA_main.h b/intern/mantaflow/intern/MANTA_main.h index 5fd94ca01bc..68a5b427e7d 100644 --- a/intern/mantaflow/intern/MANTA_main.h +++ b/intern/mantaflow/intern/MANTA_main.h @@ -412,6 +412,10 @@ struct MANTA { { return mPhi; } + inline float *getPressure() + { + return mPressure; + } static atomic<int> solverID; static int with_debug; /* On or off (1 or 0), also sets manta debug level. */ @@ -806,6 +810,7 @@ struct MANTA { int *mFlags; float *mNumObstacle; float *mNumGuide; + float *mPressure; /* Smoke grids. */ float *mDensity; diff --git a/intern/mantaflow/intern/manta_fluid_API.cpp b/intern/mantaflow/intern/manta_fluid_API.cpp index 7f96a315a8e..e4754131f34 100644 --- a/intern/mantaflow/intern/manta_fluid_API.cpp +++ b/intern/mantaflow/intern/manta_fluid_API.cpp @@ -362,6 +362,14 @@ float *manta_get_phioutstatic_in(MANTA *fluid) { return fluid->getPhiOutStaticIn(); } +float *manta_get_phi(MANTA *fluid) +{ + return fluid->getPhi(); +} +float *manta_get_pressure(MANTA *fluid) +{ + return fluid->getPressure(); +} /* Smoke functions */ void manta_smoke_export_script(MANTA *smoke, FluidModifierData *fmd) diff --git a/intern/opencolorio/ocio_impl_glsl.cc b/intern/opencolorio/ocio_impl_glsl.cc index a0bb9828bd5..e91f6021669 100644 --- a/intern/opencolorio/ocio_impl_glsl.cc +++ b/intern/opencolorio/ocio_impl_glsl.cc @@ -284,12 +284,13 @@ static void ensureGLSLLut3d(OCIO_GLSLLut3d **lut3d_ptr, int extent[3] = {LUT3D_EDGE_SIZE, LUT3D_EDGE_SIZE, LUT3D_EDGE_SIZE}; - lut3d->texture = GPU_texture_create_3d("OCIOLut", UNPACK3(extent), 1, GPU_RGB16F, NULL); + lut3d->texture = GPU_texture_create_3d( + "OCIOLut", UNPACK3(extent), 1, GPU_RGB16F, GPU_DATA_FLOAT, NULL); GPU_texture_filter_mode(lut3d->texture, true); GPU_texture_wrap_mode(lut3d->texture, false, true); lut3d->texture_display = GPU_texture_create_3d( - "OCIOLutDisplay", UNPACK3(extent), 1, GPU_RGB16F, NULL); + "OCIOLutDisplay", UNPACK3(extent), 1, GPU_RGB16F, GPU_DATA_FLOAT, NULL); GPU_texture_filter_mode(lut3d->texture_display, true); GPU_texture_wrap_mode(lut3d->texture_display, false, true); |