diff options
author | Sebastián Barschkis <sebbas@sebbas.org> | 2020-03-19 02:03:47 +0300 |
---|---|---|
committer | Sebastián Barschkis <sebbas@sebbas.org> | 2020-03-19 02:04:13 +0300 |
commit | c8b4b4c0fa3b1255a79b90393ee9f5ddb2ec35e9 (patch) | |
tree | a3e01b09116a6d7df5f95f6653b7bedc3eb4e585 /source/blender/blenkernel | |
parent | 99be00fdb11cb429b632555da3fd9eefa54f9788 (diff) |
Fluid: Fixed issue with intial velocities in liquid domains
The fix for T74762 (bf9c4af9bb74) introduced this issue. Initial velocities were not applied to liquids anymore.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/fluid.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c index dc872b933eb..edb3bc2cd4d 100644 --- a/source/blender/blenkernel/intern/fluid.c +++ b/source/blender/blenkernel/intern/fluid.c @@ -1834,7 +1834,6 @@ static void sample_mesh(FluidFlowSettings *mfs, BVHTreeNearest nearest = {0}; float volume_factor = 0.0f; - float emission_strength = 0.0f; hit.index = -1; hit.dist = PHI_MAX; @@ -1849,6 +1848,10 @@ static void sample_mesh(FluidFlowSettings *mfs, bool is_gas_flow = (mfs->type == FLUID_FLOW_TYPE_SMOKE || mfs->type == FLUID_FLOW_TYPE_FIRE || mfs->type == FLUID_FLOW_TYPE_SMOKEFIRE); + /* Emission strength for gases will be computed below. + * For liquids it's not needed. Just set to non zero value to allow initial velocity computation */ + float emission_strength = (is_gas_flow) ? 0.0f : 1.0f; + /* Emission inside the flow object. */ if (is_gas_flow && mfs->volume_density) { if (BLI_bvhtree_ray_cast(tree_data->tree, |