Hiya. I’ve been playing with SPS particles all day. They are incredible. I’m moving SPS particles around using x,y,z positioning, which is working well.
But at the same time, I really only want to display a 2d image, like those used in the particle emitter function. Help docs suggest using the 2d system for 2d particles. But I don’t see a way to manipulate their position. So, first question:
Is there a way to modify x/y position of particles in the 2d system?
It is absolutely true that if you display quad only using the 2d particle system might be more efficient even more if you use the GPUParticleSystem.
That said you do not control the position directly but more through controls like velocity and so on which are influencing the trajectory. You could even rely on noise texture to influence the particle system.
Thanks all. Just gave it a test and see that position is exposed and available in updateFunction. So 2D emitter can be used along with precise alignment of particles. Very cool!
particleSystem.updateFunction = function(particles) {
for (var index = 0; index < particles.length; index++) {
particles[index].position.x = .05;
particles[index].position.y = .05;
}
}
Also, thanks for useAlphaFromDiffuseTexture. That’s handy.
Yea, funny about https://www.babylonjs-playground.com/textures/flare.png not having an alpha channel. The black must be subtracted out somehow by the particle emitter. Have been curious about that… trying to replicate the effect with an alpha mask, but no luck with it.
I don’t have the wherewithal at the moment to turn this into a PG. But SPS particles are rocking my world atm: https://www.dropbox.com/s/eblcxv11hrfcore/particles.mov?dl=0