Ship trails

cg76

07-03-2009 09:29:22

Hi all,

For a ship simulator type of game, how do I create realistic ship trails?

Regards,
Cg

xadh00m

08-03-2009 22:58:31

Maybe this nice hack is what you are looking for: http://www.ogre3d.org/forums/viewtopic.php?f=1&t=47645

xad

cg76

10-03-2009 08:10:47

Maybe this nice hack is what you are looking for: http://www.ogre3d.org/forums/viewtopic.php?f=1&t=47645

xad


Hi xad,

This is my first attempt http://www.youtube.com/watch?v=-Usp7KZvZq8 to create the water wake using the wake.png texture from http://www.ogre3d.org/forums/viewtopic.php?f=1&t=47645, any idea on how to improve the water wake? Below is my particle file:


particle_system Water/Wake
{
quota 220
material Water/Wake
particle_width 1.5
particle_height 1.5
cull_each true
renderer billboard
billboard_type point

emitter Box
{
angle 0
colour 1 1 1 1
colour_range_start 1 1 1 1
colour_range_end 1 1 1 0
direction 0 1 0
emission_rate 10
position 0 0.2 0
velocity_min 0.0
velocity_max 0.4
time_to_live_min 5
time_to_live_max 7
duration 0
duration_min 0
duration_max 0
repeat_delay 0
repeat_delay_min 0
repeat_delay_max 0
width 2
height 2
depth 1
}

affector Scaler
{
rate 0.6
}

affector ColourFader2
{
red1 0
green1 0
blue1 0
alpha1 0
red2 0
green2 0
blue2 0
alpha2 -1
state_change 1
}
}


and my material file:


material Water/Wake
{
technique
{
pass
{
lighting off
scene_blend alpha_blend
depth_write off

texture_unit
{
texture wake.png
}
}
}
}



Thanks,
CG

dudeabot

10-03-2009 17:12:14

dont you have to create a "sphere" mesh instead of a particle system?

al2950

11-03-2009 16:28:56

The simplest way to create ships trails with Hydrax is to use Hydrax's DecalManager. I have not actually got round to doing this yet so i cant tell you exactly what to do but will get round to it soon.

Angus

Xavyiy

11-03-2009 23:54:55

Maybe render Ship trails with decals can be a little slow, because each decal needs a new pass in the Hydrax material, so.. if with a good particle system script you're able to get a realistic ship trail, it'll be fine!

Xavi

P.D.: Decals are useful to render needed things over the water, because with 20/30 on the water the frame frop could be 10/15fps, and it's not very good..., so I suggets avoid decals to details, and use them only if they are really needed!

cg76

12-03-2009 06:06:25

Maybe render Ship trails with decals can be a little slow, because each decal needs a new pass in the Hydrax material, so.. if with a good particle system script you're able to get a realistic ship trail, it'll be fine!

Xavi

P.D.: Decals are useful to render needed things over the water, because with 20/30 on the water the frame frop could be 10/15fps, and it's not very good..., so I suggets avoid decals to details, and use them only if they are really needed!


Hi Xavi,

How do I remove the blue background of the particle image as depicted in the screen shot?

[attachment=0]particle.jpg[/attachment]

I've added the particle material to Hydrax using


mHydrax->getMaterialManager()->addDepthTechnique(
static_cast<Ogre::MaterialPtr>(Ogre::MaterialManager::getSingleton().getByName("Water/Wake"))->createTechnique());


but the blue background is still there. Below is my particle material:


material Water/Wake
{
technique
{
pass
{
lighting off
scene_blend alpha_blend
depth_write off

texture_unit
{
texture smoke.png
}
}
}
}


and particle script:


particle_system Water/Wake
{
quota 500
material Water/Wake
particle_width 30
particle_height 30
cull_each false
renderer billboard
billboard_type perpendicular_common
common_direction 0 1 0
common_up_vector 0 0 1

emitter Point
{
angle 0
colour 1 1 1 1
direction -1 0 0
emission_rate 10
position 0 0 0
velocity_min 0.0
velocity_max 1
time_to_live_min 4
time_to_live_max 4
duration 0
duration_min 0
duration_max 0
repeat_delay 0
repeat_delay_min 0
repeat_delay_max 0
width 10
height 20
//depth 10
}

affector Scaler
{
rate 0.6
}

affector ColourFader2
{
red1 0
green1 0
blue1 0
alpha1 0
red2 0
green2 0
blue2 0
alpha2 -1
state_change 1
}
}


I'm using the smoke texture from the samples folder and using alpha_blend.

Thanks,
CG

Xavyiy

12-03-2009 12:06:10

I think the best way is to use a custom Hydrax depth technique, just add in your particle material a new technique with "HydraxDepth" scheme name and a transparent colour pass, so the particles won't be visible for the Depth RTT, and you'll get the effect you want.
So.. something like this:
material Water/Wake
{
technique
{
pass
{
lighting off
scene_blend alpha_blend
depth_write off

texture_unit
{
texture smoke.png
}
}
technique
{
lighting off
scene_blend alpha_blend
scheme_name HydraxDepth

texture_unit{
texture FullTransparentTexture.png
}
}
}
}

must work!

Remember that if you use your custom Hydrax depth technique you shouldn't call Hydrax::MaterialManager::addDepth...

Post results :)

Xavi

cg76

13-03-2009 05:32:46

I think the best way is to use a custom Hydrax depth technique, just add in your particle material a new technique with "HydraxDepth" scheme name and a transparent colour pass, so the particles won't be visible for the Depth RTT, and you'll get the effect you want.
So.. something like this:
material Water/Wake
{
technique
{
pass
{
lighting off
scene_blend alpha_blend
depth_write off

texture_unit
{
texture smoke.png
}
}
technique
{
lighting off
scene_blend alpha_blend
scheme_name HydraxDepth

texture_unit{
texture FullTransparentTexture.png
}
}
}
}

must work!

Remember that if you use your custom Hydrax depth technique you shouldn't call Hydrax::MaterialManager::addDepth...

Post results :)

Xavi


Hi Xavi,

It works but when the particles are on/in the water, it didn't get rendered at all http://www.youtube.com/watch?v=gyp41AVnXuw I'm trying to obtain this wake effect [attachment=0]med_newwake.jpg[/attachment], possible to achieve it using Particle System? I've been changing my particle script but the result is not good, any advices from anyone?

Thanks,
CG

Xavyiy

13-03-2009 09:51:57

My fault, the correct way to get it working is using the Hydrax::addDepthTextureTechnique(...), you can find more information here: viewtopic.php?f=20&t=9235
Hope it'll work!

Xavi