From 7d517d4a71353982497209312c3edc98425a84fc Mon Sep 17 00:00:00 2001 From: MrCdK Date: Fri, 10 Nov 2017 23:19:08 +0100 Subject: Fix particles' tangential acceleration randomness --- scene/3d/particles.cpp | 4 ++-- 1 file 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"; -- cgit v1.2.3