Using particles for boat wake effects?
by GregM · in Torque Game Engine · 08/02/2005 (11:37 pm) · 9 replies
Is there an easy way to control X, Y and Z distribution of particles created by the PlayerFoamEmitter?
I'm trying to create more realistic wake effects behind water vehicles and would like to generate PlayerFoamParticles or other particles that conform to the XY plane of the waterblock and propagate slowly outward in a wake like fashion before they disappear.
My art guy says he can make some very nice wake effects if I can get this working, but the PlayerFoamEmitter and PlayerFoamParticle datablocks don't seem to support it and my google kung-fu has failed me.
I'm trying to create more realistic wake effects behind water vehicles and would like to generate PlayerFoamParticles or other particles that conform to the XY plane of the waterblock and propagate slowly outward in a wake like fashion before they disappear.
My art guy says he can make some very nice wake effects if I can get this working, but the PlayerFoamEmitter and PlayerFoamParticle datablocks don't seem to support it and my google kung-fu has failed me.
#2
08/03/2005 (6:14 pm)
Well, the only thing that concerns me about making a boat wake with particles is how long th wake is going to be. If it's really long like actual boat wakes are it could seriously take a hit to your framerate. However if the wake's short, like not longer than the boat then it'll be fine and look cool.
#3
For those playing along at home here is what I came up with:
Forum Thread: Complete Particle Definitions
Forum Thread: phi/theta values in particleEmitters
Code: Improved Particle Emitters
Sam, we're doing it with the RTS pack, so the boats are fairly small and distant from the camera. we should be able to tune the number and duration of particles to get acceptable performance. My artist is going for a stylized slightly exaggerated look so realism won't be too important.
08/03/2005 (6:46 pm)
Ben thanks, Thats exactly what I needed to search for.For those playing along at home here is what I came up with:
Forum Thread: Complete Particle Definitions
Forum Thread: phi/theta values in particleEmitters
Code: Improved Particle Emitters
Sam, we're doing it with the RTS pack, so the boats are fairly small and distant from the camera. we should be able to tune the number and duration of particles to get acceptable performance. My artist is going for a stylized slightly exaggerated look so realism won't be too important.
#4
What he is trying to do is lay a large wake textured particle on the surface of the water behind the boat. For this to work the particle must lay flat on the XY plane and orient itself in relation to the facing of the boat when it spawns.
If anyone knows how to make this work I'd appreciate the input. I'm going to dig into the code tonight and see if I can't come up with something. If I get it working I'll post about it here.
Thanks,
Cholly and the SYB team
08/04/2005 (1:38 pm)
Well, that worked great, but it turns out it's not quite what my art guy had in mind. I misunderstood what he was doing until he sent me his new art and modified script.What he is trying to do is lay a large wake textured particle on the surface of the water behind the boat. For this to work the particle must lay flat on the XY plane and orient itself in relation to the facing of the boat when it spawns.
If anyone knows how to make this work I'd appreciate the input. I'm going to dig into the code tonight and see if I can't come up with something. If I get it working I'll post about it here.
Thanks,
Cholly and the SYB team
#5
Have you looked at Decals?
08/04/2005 (2:57 pm)
Same deal; I'd add a flag to render particles oriented along a specified normal. Maybe also allow some sort of "snap to plane" behavior via either straight assignment or a raycast.Have you looked at Decals?
#6
I read recently that the Glyph team uses particles laying on an XY plane in TGE for some of their effects as well.
08/04/2005 (4:04 pm)
I have not looked at decals. The particles look great (when they work) and are the method used by several engines so I figured that would be the sensible path to start out on.I read recently that the Glyph team uses particles laying on an XY plane in TGE for some of their effects as well.
#7
08/04/2005 (6:10 pm)
Particles are a fine solution; I only mention decals because they're already designed to lay flat on a surface, so might be marginally more useful.
#8
In our ship game, enemy ships will render "under" the particles - looking very dumb
08/05/2005 (1:41 am)
Watch out for a "feature" that we found doing exactly the same - when another ship drives over particles you will have sorting order problems.In our ship game, enemy ships will render "under" the particles - looking very dumb
#9
In ParticleEngine.cc I added an "orientToXY" flag that is similar to "orientParticles". I then created a new function called renderFlatParticle based on renderOrientedParticle. To keep things simple (first try wasn't and failed) I removed the camView parameter and replaced it with a Point3F that grabs the particle position and increases the Z value by 100. Thus instead of facing the camera, the particle always faces a point directly up. I guess instead of 100 I could have used 1 or pi or really any non-zero value.
08/21/2005 (4:09 pm)
Okay, I've done a bit of experimenting with this. Inspired by Kyle Goodwins comments here: http://www.garagegames.com/mg/forums/result.thread.php?qt=22697#262749 In ParticleEngine.cc I added an "orientToXY" flag that is similar to "orientParticles". I then created a new function called renderFlatParticle based on renderOrientedParticle. To keep things simple (first try wasn't and failed) I removed the camView parameter and replaced it with a Point3F that grabs the particle position and increases the Z value by 100. Thus instead of facing the camera, the particle always faces a point directly up. I guess instead of 100 I could have used 1 or pi or really any non-zero value.
Associate Kyle Carter