diff options
author | Jacques Lucke <mail@jlucke.com> | 2019-09-12 16:55:47 +0300 |
---|---|---|
committer | Jacques Lucke <mail@jlucke.com> | 2019-09-12 16:55:47 +0300 |
commit | 9e9e150b7472b3f2d63781c44c106a233a758bc9 (patch) | |
tree | d17b8c67b87b5bd790eeb30a122e5481cbdb03f7 /source/blender/simulations/bparticles/forces.cpp | |
parent | 592470b07b405547f7a8065ff5330f9f0a882b95 (diff) |
size parameter in turbulence force node
Diffstat (limited to 'source/blender/simulations/bparticles/forces.cpp')
-rw-r--r-- | source/blender/simulations/bparticles/forces.cpp | 7 |
1 files changed, 4 insertions, 3 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; } } |