diff options
author | Poommetee Ketson <poommetee@protonmail.com> | 2017-11-11 13:30:00 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-11 13:30:00 +0700 |
commit | 045bf23207754f17184770ad4371cf7bff582468 (patch) | |
tree | bec18721ee0bcb191b08c239576b655a58cf00d3 /scene | |
parent | aca18b6a4929554bac5936a83a6e5c5fd0419b8f (diff) | |
parent | 7d517d4a71353982497209312c3edc98425a84fc (diff) |
Merge pull request #12825 from mrcdk/particles_fix_tangent_random
Fix particles' tangential acceleration randomness
Diffstat (limited to 'scene')
-rw-r--r-- | scene/3d/particles.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/3d/particles.cpp b/scene/3d/particles.cpp index 040266843d..6ac6e52367 100644 --- a/scene/3d/particles.cpp +++ b/scene/3d/particles.cpp @@ -761,11 +761,11 @@ void ParticlesMaterial::_update_shader() { code += " force += length(diff) > 0.0 ? normalize(diff) * (radial_accel+tex_radial_accel)*mix(1.0,rand_from_seed(alt_seed),radial_accel_random) : vec3(0.0);\n"; code += " //apply tangential acceleration;\n"; if (flags[FLAG_DISABLE_Z]) { - code += " force += length(diff.yx) > 0.0 ? vec3(normalize(diff.yx * vec2(-1.0,1.0)),0.0) * ((tangent_accel+tex_tangent_accel)*mix(1.0,rand_from_seed(alt_seed),radial_accel_random)) : vec3(0.0);\n"; + code += " force += length(diff.yx) > 0.0 ? vec3(normalize(diff.yx * vec2(-1.0,1.0)),0.0) * ((tangent_accel+tex_tangent_accel)*mix(1.0,rand_from_seed(alt_seed),tangent_accel_random)) : vec3(0.0);\n"; } else { code += " vec3 crossDiff = cross(normalize(diff),normalize(gravity));\n"; - code += " force += length(crossDiff) > 0.0 ? normalize(crossDiff) * ((tangent_accel+tex_tangent_accel)*mix(1.0,rand_from_seed(alt_seed),radial_accel_random)) : vec3(0.0);\n"; + code += " force += length(crossDiff) > 0.0 ? normalize(crossDiff) * ((tangent_accel+tex_tangent_accel)*mix(1.0,rand_from_seed(alt_seed),tangent_accel_random)) : vec3(0.0);\n"; } code += " //apply attractor forces\n"; code += " VELOCITY += force * DELTA;\n"; |