summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMrCdK <contact@mrcdk.com>2017-11-10 23:19:08 +0100
committerMrCdK <contact@mrcdk.com>2017-11-10 23:19:08 +0100
commit7d517d4a71353982497209312c3edc98425a84fc (patch)
tree7bf6782a154f3c7c3763814d3542efb5691def4d
parent19b1ff0fc5f7acce23176ad6c8752604357472f0 (diff)
Fix particles' tangential acceleration randomness
-rw-r--r--scene/3d/particles.cpp4
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";