ParticleEmitters disappear
by Norv Brooks · in Technical Issues · 08/09/2006 (2:15 pm) · 14 replies
I'm using particleEmitters to create a growing wildfire. I use both fire & smoke particleEmitters. I move them to indicate fire growth, and as each particleEmitter moves a set distance, it spawns another fire/smoke particleEmitter compbination. It seems to work fine for a period of time, but then the fire particleEmitters start to fade out eventually disappearing. (see 3 images below showing progression) I've been able to get up to approx. 95 fire & smoke emitters before they fade out taking about 9 mins to reach the point where they disappear. But, also, it has occurred with as few as about 45 emitters & 3 mins. The smoke emitters remain, and if I dolly closer, the fire emitters will appear.
Anyone had a similar experience or any suggestions?
Thanks,
Norv



Anyone had a similar experience or any suggestions?
Thanks,
Norv



About the author
#2
I'm using torque script to move the emitters. I haven't ruled out the possibilty that they may be rendered under the terrain. I don't think that's it for two reasons. First, all the wildfire emitters seem to disappear on the same move cycle. Second, I'm using "getTerrainHeight(x,y)" to set the "z" axis in the %obj.setTransform(%position);
Thanks for the interest.
Norv
08/09/2006 (4:41 pm)
Ramen-sam,I'm using torque script to move the emitters. I haven't ruled out the possibilty that they may be rendered under the terrain. I don't think that's it for two reasons. First, all the wildfire emitters seem to disappear on the same move cycle. Second, I'm using "getTerrainHeight(x,y)" to set the "z" axis in the %obj.setTransform(%position);
Thanks for the interest.
Norv
#3
08/09/2006 (5:02 pm)
Terrain LOD might cause it to go "under" the terrain at a distance maybe? Try giving the %z position a slight offset to make sure it's above the ground?
#4
It does look encouraging increasing the %z position. I tried increasing by a small amount and then again by a little more and it seemed to be better. I need to work with it some more. I'm beginning to wonder how reliable is "getTerrainHeight(x,y)"? Any info on that question?
Norv
08/09/2006 (7:57 pm)
Ramen-sama & Paul,It does look encouraging increasing the %z position. I tried increasing by a small amount and then again by a little more and it seemed to be better. I need to work with it some more. I'm beginning to wonder how reliable is "getTerrainHeight(x,y)"? Any info on that question?
Norv
#5
Cause i can set the transform on an emitter and nothing will appear to happen. To get it to actually move, i have to do something like .setscale("1 1 1"); and it'll actually change positions. Just for fun, after you move it, try setting the scale and see if it makes any difference.
08/09/2006 (9:33 pm)
Hmmmm ok so when you move the emitter... are you doing anything special?Cause i can set the transform on an emitter and nothing will appear to happen. To get it to actually move, i have to do something like .setscale("1 1 1"); and it'll actually change positions. Just for fun, after you move it, try setting the scale and see if it makes any difference.
#6
08/10/2006 (7:11 am)
Yes, "setScale("1 1 1") is necessary, that is part of my code. For more discussion on moving a particlesEmitter see this Post : www.garagegames.com/mg/forums/result.thread.php?qt=22069
#7
So are you saying that if the camera just sits still... for long enough, that the emitters will just fade and disappear? perhaps you could explain your symptoms a bit more.
08/10/2006 (3:25 pm)
I'm faily familiar with moving particles as well. i do so in my project. But i've never had them disappear unless the bounds of the emitter are not in view of the camera.So are you saying that if the camera just sits still... for long enough, that the emitters will just fade and disappear? perhaps you could explain your symptoms a bit more.
#8
08/11/2006 (3:32 pm)
I think I know what the problem may be. GetTerrainHeight is probably only accurate to the center of that particular grid-block of terrain, which is not accurate enough for something existing on a small area like the emitters. I think that function is meant to be used for manipulating terrain itself. And since terrain occludes objects behind it, your particles are probably being placed behind the terrain due to the imprecision. Maybe try using a downward raycast instead of getTerrainHeight for setting you %z position?
#9
Yes, if you just let the camera sit still, eventually the emitters just fade and disappear.
Paul,
I was questioning the reliabilty of "getTerrainHeight(x,y), also. Thanks for your info. I'm afraid, I'm not familiar with using a downward raycast. I'll try to do a search on it. If you know of a post that you can direct me to, I would appreciate it.
Also, Edward F Maurina III said the following in regards moving emitters :
Thanks
08/11/2006 (5:18 pm)
Ramen-sama,Yes, if you just let the camera sit still, eventually the emitters just fade and disappear.
Paul,
I was questioning the reliabilty of "getTerrainHeight(x,y), also. Thanks for your info. I'm afraid, I'm not familiar with using a downward raycast. I'll try to do a search on it. If you know of a post that you can direct me to, I would appreciate it.
Also, Edward F Maurina III said the following in regards moving emitters :
Quote: All in all, this is a bad way to move your emitter and it is not a smooth way to translate it's position over time. For that, use a mounted emitter, or use a projectile w/ no shape and no onCollision() damage, or... well there are various options, depending on your need.So, I've been trying to mount emitters to a AIPlayer object, but so far they don't seem to be working. Can you mount emitters to a player?
Thanks
#10
08/12/2006 (3:16 pm)
If you're an SDK owner, there's a resource for doing just that. But I don't think it's been approved yet
#11
[

Thanks to everyone who offered assistance.
Norv
08/21/2006 (7:38 pm)
For anyone who might still be following this thread, I've finally got it to work. I'm able to move both fire emitters and smoke emitters in a manner that fits the design of the game without anything disappearing. I did some different things; so, I'm not exactly sure which resolved the issue. I'm now using both "getTerrainHeight() and "containerRayCast" for setting the elevation or height of the emitters. Also, I went back to using the "chimneyfire" and "chimneysmoke" emitter data from the "starter.fps" project. I had previously modified several of the parameters for my own emitter data. So, a combination of these things seems to have done the trick. See pictures below and compare with the pictures above.
[

Thanks to everyone who offered assistance.
Norv
#12
08/21/2006 (7:52 pm)
Pics don't work.
Torque Owner Cinder Games
Are you certain the emitters are not being rendered under the terrain?