Moving particle emitters
by Chris \"Hobbiticus\" Weiland · in Torque Game Engine · 08/24/2003 (4:53 pm) · 2 replies
So, I've been playing around with the particle system, trying to get actual jets on our players. So, when you start jetting, a smoke trail comes out of the jetpack. I have it all working, but I'm running into an issue when they're moving.
As far as I can tell:
1) Particles get occluded. However, they are not occluded by individual particles, but by each particle emitter. So, if particles are being omitted around a corner but the particles *should* be able to be seen because of their velocity, they won't render.
2) Particles are drawn in OBJECT SPACE according to the EMITTER. This means that if the emitter's position changes, so do all of the particles it has emitted!
So, If I "attatch" the emitter to the player (set emitter position right before emitting particles to where they should emit from), the particles don't stay put, but cling to the emitter. If I never set the emitter position, the particles get occluded according to where the player spawned from (if spawn point is behind something, no particles are rendered).
I hacked a way in where I would set the position of the emitter when the jet is started and emit particles from the difference of the player position and the emitter position plus the node position. This works ok if the jet doesn't stay on too long and the player flies around a corner and as long as the partices do not have a long life time (partices suddently change position if you start getting a few times in a row).
Also, since the particle render sets the viewport according to the emitter, it's possible to jet out a door and only have particles render if they are over the door. So, if you start jetting just behind a door and go outside, all particles that do not overlap the door won't be rendered, those that cover the side of the door are only rendered inside the door (clipped), and those covering the door are rendered completely.
So, is this the best I can do, or is there actually a way to have a good moving particle emitter?
As far as I can tell:
1) Particles get occluded. However, they are not occluded by individual particles, but by each particle emitter. So, if particles are being omitted around a corner but the particles *should* be able to be seen because of their velocity, they won't render.
2) Particles are drawn in OBJECT SPACE according to the EMITTER. This means that if the emitter's position changes, so do all of the particles it has emitted!
So, If I "attatch" the emitter to the player (set emitter position right before emitting particles to where they should emit from), the particles don't stay put, but cling to the emitter. If I never set the emitter position, the particles get occluded according to where the player spawned from (if spawn point is behind something, no particles are rendered).
I hacked a way in where I would set the position of the emitter when the jet is started and emit particles from the difference of the player position and the emitter position plus the node position. This works ok if the jet doesn't stay on too long and the player flies around a corner and as long as the partices do not have a long life time (partices suddently change position if you start getting a few times in a row).
Also, since the particle render sets the viewport according to the emitter, it's possible to jet out a door and only have particles render if they are over the door. So, if you start jetting just behind a door and go outside, all particles that do not overlap the door won't be rendered, those that cover the side of the door are only rendered inside the door (clipped), and those covering the door are rendered completely.
So, is this the best I can do, or is there actually a way to have a good moving particle emitter?
#2
08/25/2003 (3:52 pm)
Well, apparently, between the 3 different emitParticles() functions, 1 is a wrapper for the 2nd, and the 3rd is COMPLETELY DIFFERENT. The 3rd seems to be only for use where you just want to emit a bunch of particles once, like a splash. This is the one I was using. The other 2 seem to be very much less efficent, and it's killing the framerate doing the same exact thing. BUT, it seems like they actually do what I want for the most part.
Associate Kyle Carter
Or else just have a short range particle effect until the problem is properly fixed, I don't think either Tribes 1 or Tribes 2 had a long dangly smoke trail coming off the jetpack.