Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <mail@jlucke.com>2019-09-12 16:55:47 +0300
committerJacques Lucke <mail@jlucke.com>2019-09-12 16:55:47 +0300
commit9e9e150b7472b3f2d63781c44c106a233a758bc9 (patch)
treed17b8c67b87b5bd790eeb30a122e5481cbdb03f7 /source/blender
parent592470b07b405547f7a8065ff5330f9f0a882b95 (diff)
size parameter in turbulence force node
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/simulations/bparticles/forces.cpp7
-rw-r--r--source/blender/simulations/bparticles/node_frontend.cpp2
2 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/simulations/bparticles/forces.cpp b/source/blender/simulations/bparticles/forces.cpp
index ffd16aca14c..fed9dc35a8c 100644
--- a/source/blender/simulations/bparticles/forces.cpp
+++ b/source/blender/simulations/bparticles/forces.cpp
@@ -37,10 +37,11 @@ void TurbulenceForce::add_force(ForceInterface &interface)
for (uint pindex : interface.pindices()) {
float3 pos = positions[pindex];
float3 strength = inputs->get<float3>("Strength", 0, pindex);
+ float size = inputs->get<float>("Size", 1, pindex);
float weight = weights[pindex];
- float x = (BLI_gNoise(0.5f, pos.x, pos.y, pos.z + 1000.0f, false, 1) - 0.5f) * strength.x;
- float y = (BLI_gNoise(0.5f, pos.x, pos.y + 1000.0f, pos.z, false, 1) - 0.5f) * strength.y;
- float z = (BLI_gNoise(0.5f, pos.x + 1000.0f, pos.y, pos.z, false, 1) - 0.5f) * strength.z;
+ float x = (BLI_gNoise(size, pos.x, pos.y, pos.z + 1000.0f, false, 1) - 0.5f) * strength.x;
+ float y = (BLI_gNoise(size, pos.x, pos.y + 1000.0f, pos.z, false, 1) - 0.5f) * strength.y;
+ float z = (BLI_gNoise(size, pos.x + 1000.0f, pos.y, pos.z, false, 1) - 0.5f) * strength.z;
destination[pindex] += float3(x, y, z) * weight;
}
}
diff --git a/source/blender/simulations/bparticles/node_frontend.cpp b/source/blender/simulations/bparticles/node_frontend.cpp
index 852bb3f7697..7bbe28e69ff 100644
--- a/source/blender/simulations/bparticles/node_frontend.cpp
+++ b/source/blender/simulations/bparticles/node_frontend.cpp
@@ -546,7 +546,7 @@ static void PARSE_turbulence_force(BehaviorCollector &collector,
WorldTransition &UNUSED(world_transition),
VirtualNode *vnode)
{
- FN::TupleCallBody &body = vtree_data.function_body_for_inputs(vnode, {1});
+ FN::TupleCallBody &body = vtree_data.function_body_for_inputs(vnode, {2});
FN_TUPLE_CALL_ALLOC_TUPLES(body, fn_in, fn_out);
body.call__setup_execution_context(fn_in, fn_out);