Search the Community
Showing results for tags 'SPS solid particle system'.
-
I'm having some framerate issues (granted there are 240k vertices)... Getting about 58 on Desktop... Drops to 15 Chrome on Laptop and then 8 on Firefox on Laptop... http://crab.strangled.net/ I think this is the issue -- I need a method of skipping calculations... I tried Jerome's suggestion of waiting to calculate every 3 frames but this causes a stutter... Any suggestions welcome! Thanks in advance! SPS.recycleParticle = function (particle) { if (particle.idx > particleCount) { particle.alive = false; } else { particle.alive = true; } if (!particle.alive) { if (particle.scale.y == 0) { return; } particle.scale.x = 0; particle.scale.y = 0; particle.scale.z = 0; particle.position.x = Math.random() * 6; particle.position.y = Math.random() * 6; particle.position.z = Math.random() * 6; return; } else { particle.position.x = Math.random() * 6; particle.position.y = Math.random() * 6; particle.position.z = Math.random() * 6; particle.velocity.x = (Math.random() - 0.5) * speed; particle.velocity.y = Math.random() * speed; particle.velocity.z = (Math.random() - 0.5) * speed; var scale = scaleValue - 3 * (Math.random()); particle.scale.x = scale; particle.scale.y = scale; particle.scale.z = scale; particle.rotation.x = Math.seededRandom() * 3.5; particle.rotation.y = Math.seededRandom() * 3.5; particle.rotation.z = Math.seededRandom() * 3.5; particle.color.r = Math.random() * 0.6 + 0.5; particle.color.g = Math.random() * 0.6 + 0.5; particle.color.b = Math.random() * 0.6 + 0.5; } };